Homework5 STAT 425 - setwd/Users/Bcollender/STAT 425...

This preview shows page 1 out of 1 page.

setwd("/Users/Bcollender/STAT 425")getwd()#question 1Data1 <- read.table("destroyers.dat", header=TRUE)model1 <- lm(log(Displacement)~Length+Beam, data = Data1)summary(model1)model2 <- lm(log(Displacement)~Length+Beam+I(Length*Length)+I(Beam*Beam)+I(Length*Beam), data = Data1)summary(model2)anova(model1)anova(model2)SSR1 = sum(model1$residuals^2)SSR2 = sum(model2$residuals^2)FStat = ((SSR1-SSR2)/(3))/(SSR2/27)FStat1-pf(FStat, 3, 27)Bkwrd1 = model2drop1(Bkwrd1, test = "F")Bkwrd1 = update(Bkwrd1, .~. - Length)drop1(Bkwrd1, test = "F")#question 2model3 <- lm(weight~feed, data = chickwts)

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture