{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ch2problem29-rcode - Chapter 2 Problem 29 The data for this...

Info iconThis preview shows pages 1–6. 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 *** # Residuals 58 3874.4 66.8 # --- # Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 # Note that the row for "Total" is not given on this output. # Make sure you include this row when you write up your homework! # Part c. # Hypotheses: # H0: beta_1 = 0 # Ha: beta_1 != 0 # Test Statistic # F* = 174.06 (from above)
Background image of page 1

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

View Full Document Right Arrow Icon
Background image of page 2
Background image of page 3

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

View Full Document Right Arrow Icon
Background image of page 4
Background image of page 5

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

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

{[ snackBarMessage ]}