Advertisement
Guest User

lefty_out

a guest
Mar 3rd, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. > data.frame(y = c(332928,358323,422244,430035,3168,2397,3099,5508,23802,26346,28546,33933,2286,2370,5667,9468,6024,5370,6126,7971,5979,4893,5007,6381,17985,18771,24081,26532),t=rep(c(1996,2001,2006,2013),7),type=rep(c("car","mb","bus","train","other","bike","walk"),each=4)) -> dat
  2. >
  3. > dat$t96 <- dat$t-1996
  4. > dat$type <- relevel(dat$type, "car")
  5. >
  6. > model <- lm(log(y) ~ t96*type, data=dat)
  7. > summary(model)
  8.  
  9. Call:
  10. lm(formula = log(y) ~ t96 * type, data = dat)
  11.  
  12. Residuals:
  13. Min 1Q Median 3Q Max
  14. -0.279909 -0.063599 0.003915 0.076055 0.229129
  15.  
  16. Coefficients:
  17. Estimate Std. Error t value Pr(>|t|)
  18. (Intercept) 12.727926 0.130850 97.271 < 2e-16 ***
  19. t96 0.016191 0.012862 1.259 0.228661
  20. typebike -4.152250 0.185049 -22.439 2.25e-12 ***
  21. typebus -2.655501 0.185049 -14.350 9.13e-10 ***
  22. typemb -4.896199 0.185049 -26.459 2.35e-13 ***
  23. typeother -4.125717 0.185049 -22.295 2.45e-12 ***
  24. typetrain -5.136153 0.185049 -27.756 1.22e-13 ***
  25. typewalk -2.950006 0.185049 -15.942 2.27e-10 ***
  26. t96:typebike -0.010925 0.018189 -0.601 0.557700
  27. t96:typebus 0.004381 0.018189 0.241 0.813167
  28. t96:typemb 0.020331 0.018189 1.118 0.282497
  29. t96:typeother 0.002156 0.018189 0.119 0.907337
  30. t96:typetrain 0.075565 0.018189 4.154 0.000973 ***
  31. t96:typewalk 0.008839 0.018189 0.486 0.634536
  32. ---
  33. Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  34.  
  35. Residual standard error: 0.1617 on 14 degrees of freedom
  36. Multiple R-squared: 0.9947, Adjusted R-squared: 0.9897
  37. F-statistic: 201.2 on 13 and 14 DF, p-value: 1.395e-13
  38.  
  39. > anova(model)
  40. Analysis of Variance Table
  41.  
  42. Response: log(y)
  43. Df Sum Sq Mean Sq F value Pr(>F)
  44. t96 1 1.031 1.0307 39.432 2.024e-05 ***
  45. type 6 66.549 11.0915 424.356 5.214e-15 ***
  46. t96:type 6 0.775 0.1292 4.943 0.006513 **
  47. Residuals 14 0.366 0.0261
  48. ---
  49. Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement