AMS 578 Homework 1 solution
Problem 1:
a.
> setwd("C:/spring 2009 TA/hw1");
> file data attach(data);
> muy mux b1 b0 b1
[1] 0.03882713
> b0
[1] 2.114049
So the LSE of β0and β1are, separately, 2.114049 and 0.03882713.
The estimated regression function is: Y= 0.03882713*X +2.114049
b.
> par(mar plot(Y~X, pch=20);
> abline(b0,b1,col=2);
> legend(20,1, legend=c("Y= 0.03882713*X +2.114049"), col=2,lty=1,text.col=2,bty="n"); c.
E(Y|X= 30) = 0.03882713*30 +2.114049 = 3.278863
d.
The point estimate of the change in the mean response is just the b , 1.03882713.
Problem 2:
a.
> resid MSE sb1 sb1
[1] 0.01277302
> CI CI
[1] 0.005385614 0.072268640
So the 99 percent confidence interval is (0.005385614, 0.072268640), which doesn’t include
zero. That means there is the significant relationship existed between the ACT score and the
GPA at the end of the freshman year.
b.
H 0 β 1 0;
H : β ≠ 0;
a 1 *
And the decision rule is if |t | ≥1-a/2,n-2,will reject H .0
Here a=0.01, n= 120 So:
> ts=b1/sb1;
> abs(ts)-qt(0.995,118);
[1] 0.4216398
*
That means |t | ≥ 0.995,118which means given the significance level 0.01, we reject H . 0
c.
> pvalue pvalue;
[1] 0.002916604
The P-value is 0.002916604, less than 0.01. So it gives the same decision in part (b).
Problem 3:
a.
> Yh=b0+b1*28;
> sYh=sqrt(MSE*(1/120+sum((28-mux)^2)/sum((X-mux)^2)));
> YhCI YhCI [1] 3.061384 3.341033
So the 95 percent confidence interval is [3.061384, 3.341033], which means GPA of the student
whose ACT is 28, will be somewhere between 3.061384 and 3.341033 with 95% possibility.
b.
> Ypred=b0+b1*28;
> sYpred=sqrt(MSE*(1+1/120+sum((28-mux)^2)/sum((X-mux)^2)));
> YpredCI YpredCI
[1] 1.959355 4.443063
So the 95 percent prediction interval is [1.959355, 4.443063], which means Mary’s GPA will be
somewhere between 1.959355 and 4.443063with 95% possibility.
c.
Yes,
Yes.
d.
> W YhCB YhCB
[1] 3.026159 3.376258
The 95 percent confidence band is [3.026159, 3.376258] when X h28. And it is do wider than
the confidence interval in part (a).
Problem 4:
a.
> file data attach(data);
> muy
> b1 b0 c(b0,b1);
[1] -0.5801567 15.0352480
The estimated regression function is: Y= 15.0352480*X - 0.5801567.
b.
> par(mar plot(Y~X,pch=20);
> abline(b0,b1,col=2); > legend(4,10, legend=c("Y= 15.0352480*X - 0.5801567"), col=2,lty=1,text.col=2,bty="n");
c.
b0 is the intercept value of the regression function at X = 0. But this linear regression model is
applied to number of minutes spent by the service person to service on copiers. X here represents
the number of copiers which only can be positive integer. So b0 doesn’t provide any meaningful
i

More
Less