ch2problem29-rcode

ch2problem29-rcode - # Chapter 2, Problem 29 # The data for...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 # Chapter 2, Problem 29 # The data for this problem are in from Chp 1, problem 27 names(ch1pr27.dat) <- c("mass","age") attach(ch1pr27.dat) # The fitted regression line is fit.1.27 fit.1.27 <- lm(mass~age) # Part a. par(mfrow=c(2,2)) plot(age,mass-fit.1.27$fit,pch=16,xlab="Age",ylab="y-y.hat",ylim=c(-23,25)) abline(h=10,lty=3) abline(h=-10,lty=3) abline(h=5,lty=2) abline(h=-5,lty=2) title("Evaluating elements of SSE") plot(age,fit.1.27$fit-mean(mass),pch=16,xlab="Age",ylab="y.hat-mean(y)",ylim=c(-23,25)) abline(h=10,lty=3) abline(h=-10,lty=3) abline(h=5,lty=2) abline(h=-5,lty=2) title("Evaluating elements of SSR") # The deviations (or residuals) have an overall smaller magnitude # than the deviations of y.hat-mean(y). This means that the # SSR will be larger than SSE # difference is quite substantial and, hence, R^2 will be large. # Part b. anova(fit.1.27) # Analysis of Variance Table # Response: y # Df Sum Sq Mean Sq F value Pr(>F) # age 1 11627.5 11627.5 174.06 < 2.2e-16 ***
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/16/2009 for the course STAT 540 taught by Professor Staff during the Spring '08 term at Colorado State.

Page1 / 6

ch2problem29-rcode - # Chapter 2, Problem 29 # The data for...

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

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