Guest User

Untitled

a guest
Jan 23rd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. df <- mtcars
  2.  
  3. fit1 <- gls(mpg ~ cyl + disp, data = df)
  4. fit2 <- gls(mpg ~ cyl + disp + hp, data = df)
  5.  
  6. fit1ml <- update(fit1, . ~ ., method = "ML")
  7. fit2ml <- update(fit2, . ~ ., method = "ML")
  8. anova(fit1ml, fit2ml)
  9.  
  10. > anova(fit1ml, fit2ml)
  11.  
  12. Model df AIC BIC logLik Test L.Ratio p-value
  13. fit1ml 1 4 167.1456 173.0086 -79.57282
  14. fit2ml 2 5 168.0184 175.3471 -79.00921 1 vs 2 1.127214 0.2884
Add Comment
Please, Sign In to add comment