DOC PREVIEW
UIUC STAT 420 - HW #3

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Boyang'Dai'STAT'6120'HW'#3''#3.10'data=read.table("http://www.stat.lsu.edu/exstweb/statlab/datasets/KNNLData/CH03PR10.txt")@y@=@data[,1]@x@=@data[,2]@lm@=@lm( y@~ @x )@sum@<I@su mm a ry(lm)@semi.stud.resid@<I@lm $re sid u als /su m$sigma@par(mfrow@=@c(1,1))@plot(x@=@lm$fitted.va lu es,@y @=@se m i.stu d .res id,@xla b @=@e xp re ssio n (h at( Y)) ,@ylab @= @"S emiIstudentized@residuals",@main@=@expression(paste("SemiIstudentized@residuals@vs.@",@hat(Y))),@panel.first@=@grid(col@=@"gray",@lty@=@"dotted"),@ylim@=@c(I3,3))@abline(h@=@0,@col@=@"red")@abline(h@=@c(I1,1),@col@=@"red",@lwd@=@2)@@There@are@3@semistudentized@residuals outside ±1 standard deviation. Since a plot of semistudentized residuals vs. Fitted value shows the property of nonlinearity of regression function, this plot appears as a random cloud of points centered at 0 under linearity.#3.15'a)@data=read.table("http://www.stat.lsu.edu/exstweb/statlab/datasets/KNNLData/CH03PR15.txt")@y@=@data[,1]@x@=@data[,2]@lm@=@lm(y@~@x)@lm@Call:@lm(formula@=@y@~@x)@Coefficients:@(Intercept)@ @ @ @ @ @ @ @ @ @ @ @ x@ @ @@@@@@@2.575@ @ @ @ @ @ @ I0.324@b)@Alternatives:@H0:@β1@=@0@vs@Ha:@β1@≠@0@Decision@Rule:@ F*@>@F(0.975;@3,@10),@we@conclude@H1@@ @ @ @ F*@<@F(0.975;@3,@10),@we@conclude@H0@Conclusion:@ @ F@value@[email protected];@ F(0.975;@3,@10)@[email protected]@@ @ @ @ F*@>@F(0.975;@3,@10),@we@conclude@that@β1@≠@0@@ @ @ @ The@regression@function@is@linear.@c)@We@can@conclude@that@there@is@a@lack@of@fit@of@a@linear@regression@function@exists.@@#3.16'a)@plot(x,y,@xlab@=@"Time",ylab@=@"Concentration@of@Solution",@main@=@"Scatter@Plot@of@the@Data")@lines(x,y,@type@=@"o")@@The@scatter@plot@suggests@a@Y’@=@log10Y@transformations@on@Y.@ @b)@sse@<I@c()@lambda@<I@c()@i@<I@1@gmean@<I@exp(mean(log(y)))@for@(lam@in@seq(I.2,@.2,0.1)){@if(lam@!=@0)@{tY@<I@(y^lam@I@1)/(lam*gmean^(lam@I@1))}else@{tY@<I@log(y)*gmean}@test@<I@anova(lm(tY@~@x))@sse[i]@<I@test['Residuals','Sum@Sq']@lambda[i]@<I@lam@i@<I@i+1}@cbind(lambda,sse)@@@@@@lambda@ @ @ @ @ @ @ @ sse@[1,]@ @ @ I0.2@ @ @ @ 0.12353047@[2,]@ @ @ I0.1@ @ @ @ 0.06505067@[3,]@ @ @ @ 0.0@ @ @ @ 0.03897303@[4,]@ @ @ @ 0.1@ @ @ @ 0.04396062@[5,]@ @ @ @ 0.2@ @ @ @ 0.08131793@In@this@case,@the@best@boxIcox@transformation@of@the@data@is@given@by@λ@=@0,@corresponding@to@the@Y’@=@lnY@transformation.@ @@c)@d@<I@cbind(data,@log10(y))@Y@=@d[,3]@NewModel@<I@lm(Y@~@x)@NewModel@Call:@lm(formula@=@Y@~@x)@Coefficients:@(Intercept)@ @ @ @ @ @ @ @ @ @ @ @ x@ @ @@@@@@0.6549@ @ @ @ @ @ I0.1954@@ =>@ Y ’@=@Log10Y@[email protected]@–@0.1954X@@d)@plot(Y@~@x,@main@=@"Estimated@Regression@Line",@xlab@=@"Year",@ylab@=@"Predicted@Y")@abline(NewModel,@col@=@"red")@@The@regression@line@appears@to@be@a@good@fit.@@e)@concentration.res@=@resid(NewModel)@plot(x,@concentration.res,@ylab@=@"Residuals",@xlab@=@"Time",@main@=@"Predicted@Concentration")@abline(0,0,@pch@=@22,@lty@=@2,@col@=@"red")@@concentration.stdres@=@rstandard(NewModel)@qqnorm(concentration.stdres,@ylab@=@"Cumulative@Distribution@of@Residaul",@xlab@=@"Normal@Cumulative@Distributions",@main@=@"Predicted@Concentration")@qqline(concentration.stdres)@@The@residual@plot@shows@fairly@constant@variability@and@the@normal@probability@plot@shows@normality@since@it@is@fairly@linear.@


View Full Document

UIUC STAT 420 - HW #3

Documents in this Course
Load more
Download HW #3
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view HW #3 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view HW #3 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?