Guest User

Untitled

a guest
May 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. data("mtcars")
  2. str(mtcars)
  3. m1<-lm(hp ~ disp, data = mtcars)
  4. m2<-lm(hp ~ disp + wt, data = mtcars)
  5.  
  6. library(texreg)
  7. screenreg(list(m1, m2))
  8.  
  9. ===================================
  10. Model 1 Model 2
  11. -----------------------------------
  12. (Intercept) 45.73 ** 68.84 *
  13. (16.13) (31.80)
  14. disp 0.44 *** 0.54 ***
  15. (0.06) (0.14)
  16. wt -14.45
  17. (17.10)
  18. -----------------------------------
  19. R^2 0.63 0.63
  20. Adj. R^2 0.61 0.61
  21. Num. obs. 32 32
  22. RMSE 42.65 42.85
  23. ===================================
  24. *** p < 0.001, ** p < 0.01, * p < 0.05
  25.  
  26. library(stargazer)
  27.  
  28. l1 <- lm(mpg ~ hp + drat, data=mtcars)
  29. l2 <- lm(mpg ~ disp + hp, data=mtcars)
  30.  
  31. stargazer(l1, l2, title= "Regression comparision", type="html")
Add Comment
Please, Sign In to add comment