2472i73i23 c 27202i4 a77 76272i73

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 0.21949 2.259 0.025010 * speedlow 0.48159 0.25365 1.899 0.059127 . speedmedium -0.05512 0.17905 -0.308 0.758533 Cl -0.40833 0.16843 -2.424 0.016274 * oPO4 -0.68535 0.11669 -5.873 1.88e-08 *** Chla -0.54912 0.16078 -3.415 0.000779 *** Residual standard error: 1.003 on 190 degrees of freedom Multiple R-squared: 0.5143,! Adjusted R-squared: 0.4964 F-statistic: 28.74 on 7 and 190 DF, p-value: < 2.2e-16 1 Statistics 503, Spring 2013, ISU 32 32 A/$#29()/'( O+*2(c%"()2#.*+5$"&0#)2+($ 33 Statistics 503, Spring 2013, ISU 33 A/$#29()/'( ["$24%#.$*#&"*-"&/"<)` 2 1 0 -1 -2 Sample Quantiles 2 1 0 -1 -2 Residuals 3 par(mfrow=c(1,2), pty="s") boxplot(residuals(lm3.a1), ylab="Residuals") qqnorm(residuals(lm3.a1)) Normal Q-Q Plot qqline(residuals(lm3.a1)) 3 > > > > -3 -2 -1 0 1 2 Theoretical Quantiles Statistics 503, Spring 2013, ISU 3 34 34 ["$24%#.$*#&"*-"&/"<)` small medium large low 1 medium Residuals > algaet.diag<3 data.frame(algaet.diag, 2 resid=residuals(lm3.a1), 1 pred=fitted(lm3.a1)) 0 > qplot(pred, resid, -1 data=algaet.diag, -2 xlab="Predicted values", 3 ylab="Residuals") + facet_grid(speed~size) 2 0 -1 -2 3 2 1 high 0 -1 -2 0 1 2 3 4 0 1 2 3 Predicted values 4 0 1 2 3 4 35 Statistics 503, Spring 2013, ISU 35 K+,*I++4*2$*)7"*d)e*L5$"&0"4*0$*-&"42<)"4: size: small size: large speed: medium Observed size: medium speed: low > qplot(pred, a1, 4 data=algaet.diag, 3 xlab="Predicted values", ylab="Observed") + 2 facet_grid(speed~size,1 labeller=label_both) + 0 geom_smooth( method="lm", se=F) 4 3 2 1 0 4 speed: high 3 2 1 0 0 1 2 3 4 0 1 2 3 Predicted values Statistics 503, Spring 2013, ISU 4 0 1 2 3 4 36 36 β8 Chla + τseason + τsize + τspeed + ε, ε ∼ N (0, σ 2 ) B/2$"&39+%" a1 = β0 + β1 Cl + β2 oPO4 + β3 Chla + τsize + τspeed + ε, ε ∼ N (0, σ 2 ) ￿ a1 = 5.27 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“large” and speed=“high” = 5.57 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“medium” and speed=“high” = 5.77 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“small’ and speed=“high” ... = 5.76 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“lareg” and speed=“low” a1 = β0 + β1 mxPH + β2 mnO2 + β3 Cl + β4 NO3 + β5 NH4 + β6 PO4 + β7 Chla + τseason + τsize + τspeed + ε, ε ∼ N (0, σ 2 ) Statistics 503, Spring 2013, ISU a1 = β0 + β1 mxPH + β2 mnO2 + β3 Cl + β4 NO3 + β5 NH4 + β6 oPO4 + β7 PO4 + β8 Chla + τseason + τsize + τspeed + ε, ε ∼ N (0, σ 2 ) 37 37 B/2$"&39+%" a1 = β0 + β1 Cl + β2 oPO4 + β3 Chla + τsize + τspeed + ε, ε ∼ N (0, σ 2 ) ￿ a1 = 5.27 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“large” and speed=“high” = 5.57 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“medium” and speed=“high” = 5.77 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“small’ and speed=“high” ... = 5.76 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“lareg” and speed=“low” 1 Wait! Only the intercept changes!!!! Need to fit interactions. Statistics 503, Spring 2013, ISU 37 37 β8 Chla + τseason + τsize + τspeed + ε, ε ∼ N (0, σ 2 ) B/2$"&39+%" a1 = β0 + β1 Cl + β2 oPO4 + β3 Chla + τsize + τspeed + ε, ε ∼ N (0, σ 2 ) ￿ a1 = 5.27 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“large” and speed=“high” = 5.57 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“medium” and speed=“high” = 5.77 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“small’ and speed=“high” ... = 5.76 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“lareg” and speed=“low” Statistics 503, Spring 2013, ISU 37 37 a1 = β0 + β1 mxPH + β2 mnO2 + β3 Cl + β4 NO3 + β5 NH4 + β6 PO4 + β7 Chla + τseason + τsize + τspeed + ε, ε ∼ N (0, σ 2 ) <%CD)EE a1 = β0 + β1 mxPH + β2 mnO2 + β3 Cl + β4 NO3 + β5 NH4 + β6 oPO4 + β7 PO4 + β8 Chla + τseason + τsize + τspeed + ε, ε ∼ N (0, σ 2 ) > lm5.a1 <- lm(a1 ~ size*Cl + speed*Cl + Chla + size*oPO4, data=algaet.imp[,c(1:8,9:12)]) > summary(lm5.a1)β oPO4 + β Chla + τ 2 a1 = β0 + β1 Cl + 2 3 size + τspeed + ε, ε ∼ N (0, σ ) Residual standard error: 0.9529 on 184 degrees of freedom Multiple R-squared: 0.5755,! Adjusted R-squared: 0.5455 F-statistic: 19.19 on 13 and 184 DF, p-value: < 2.2e-16 ￿ a1 = 5.27 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“large” and speed=“high” = 5.57 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“medium” and speed=“high” !+&"*0#&2#(<"*"C-.#2("43*5%)*."$$*$)#)2$)2<#..6* = 5.77 − 0.41Cl − 0.69oPO4 − 0.55Chla if size=“small’ and speed=“high” = 5.76 − 0.41Cl $2I(2d<#(): − 0.69oPO4 − 0.55Chla if size=“lareg” and speed=“low” ... R.+-"*<7#(I"$*/+&*"#<7**<#)"...
View Full Document

This note was uploaded on 02/06/2014 for the course STAT 503 taught by Professor Staff during the Fall '08 term at Iowa State.

Ask a homework question - tutors are online