hw4sol - STAT 4220 HW4 Solution 1 Problem 1 (a) See the...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
STAT 4220 HW4 Solution 1 Problem 1 (a) See the appendix for R code. Fitting the model yields the following output: > summary(g) Call: lm(formula = y ˜ factor(x)) Residuals: Min 1Q Median 3Q Max -2.64889 -0.44889 -0.04889 0.55111 2.15111 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 22.2989 0.1355 164.515 < 2e-16 *** factor(x)2 0.7911 0.2711 2.918 0.00424 ** factor(x)3 0.8225 0.2783 2.956 0.00379 ** factor(x)4 0.2761 0.2647 1.043 0.29903 factor(x)5 0.6044 0.2711 2.230 0.02773 * factor(x)6 -1.1689 0.2711 -4.312 3.46e-05 *** --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 Residual standard error: 0.9093 on 114 degrees of freedom Multiple R-squared: 0.313, Adjusted R-squared: 0.2829 F-statistic: 10.39 on 5 and 114 DF, p-value: 3.152e-08 > summary.aov(g) Df Sum Sq Mean Sq F value Pr(>F) factor(x) 5 42.940 8.5879 10.388 3.152e-08 *** Residuals 114 94.248 0.8267 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 From the ANOVA table, we see that with p ¿ . 0001, the type of bird is very significant in determining the length of the cuckoo eggs. (b) The residual plot is generated with the following code: > plot(x,g$res,xlab="Cuckoo",ylab="Residuals",pch=20,col=3, main="Plot of residual versus factor levels",xaxt="n") > mtext(paste("MDWP"),side=1,at=1) > mtext(paste("TRP"),side=1,at=2) > mtext(paste("HGSPRW"),side=1,at=3) > mtext(paste("RBN"),side=1,at=4) > mtext(paste("PWGTL"),side=1,at=5) > mtext(paste("WREN"),side=1,at=6) 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
-2 -1 0 1 2 Plot of residual versus factor levels Cuckoo Residuals MDWP TRP HGSPRW RBN PWGTL WREN (c) For the most part, the spread of the residuals seems to be fairly even across factor levels. We may have slightly smaller variance at the RBN and WREN factor levels, but it is negligible for our purposes. Deciding whether the assumption of constant variance holds based on these plots is always subjective. (d) The boxplot is generated with the following:
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/06/2011 for the course STAT 4220 taught by Professor Smith during the Spring '08 term at University of Georgia Athens.

Page1 / 7

hw4sol - STAT 4220 HW4 Solution 1 Problem 1 (a) See the...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online