MATH 376 -- Probability and Statistics 2

April 7, 2006

First Least Squares Regression Example, continued

The housing price data:

>    read "/home/fac/little/public_html/ProbStat0506/MSP.map";

Warning, the name changecoords has been redefined

49399506

Repeating computation of the estimators for the coefficients in the model

    Y = beta[0]+beta[1]*x+epsilon

We enter the lists of x   and   y   coordinates of the data points separately:

>    XList:=[0.,1,2,3,4,5,6,7];

XList := [0., 1, 2, 3, 4, 5, 6, 7]

>    YList:=[27.6,32.5,35.9,39.3,44.8,48.8,55.7,62.9];

YList := [27.6, 32.5, 35.9, 39.3, 44.8, 48.8, 55.7, 62.9]

Means:

>    Xbar:=Mean(XList);

Xbar := 3.500000000

>    Ybar:=Mean(YList);

Ybar := 43.43750000

Organizing the computation as we described in class:

>    SXY:=add((XList[i]-Xbar)*(YList[i]-Ybar),i=1..8);

SXY := 203.6500000

>    SXX:=add((XList[i]-Xbar)*(XList[i]-Xbar),i=1..8);

SXX := 42.00000000

>    hatbeta[1]:=SXY/SXX;

hatbeta[1] := 4.848809524

>    hatbeta[0]:=Ybar-hatbeta[1]*Xbar;

hatbeta[0] := 26.46666667

Now, we set up for testing H[0]  : beta[1] = 5  versus the alternative H[1]  :   beta[1] < 5

To compute the test statistic we need the estimator S^2   for the variance sigma^2

>    SYY:=add((YList[i]-Ybar)*(YList[i]-YBar),i=1..8);

SYY := 1004.158750

>    S2:=(1/(8-2))*(SYY-hatbeta[1]*SXY);

S2 := 2.7831151

Then the test statistic is   t = (hatbeta[1]-5)/(S*sqrt(c[11])) ,  where c[11] = 1/S[xx]

>    t:=(hatbeta[1] - 5)/sqrt(S2/SXX);

t := -.5873317731

The test statistic has a   t -distribution with 8 - 2 = 6 d.f.  so the

p- value is:

>    TCDF(6,t);

.2891986560

Note:  1 - TCDF(6,-t)  gives the same result by symmetry of the t

density function.

This value is much too large to indicate rejection of H[0]  .  There is

not sufficient evidence to suggest that   beta[1] < 5