Guest User

Untitled

a guest
Jan 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. library(mgcv)
  2. library(arm)
  3. example<-gamm(mag ~ s(depth), random=list(stations=~1), data=quakes)
  4. summary(example$gam)
  5. #Family: gaussian
  6. #Link function: identity
  7.  
  8. #Formula:
  9. # mag ~ s(depth)
  10.  
  11. #Parametric coefficients:
  12. # Estimate Std. Error t value Pr(>|t|)
  13. #(Intercept) 5.02300 0.04608 109 <2e-16 ***
  14. # ---
  15. # Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  16.  
  17. #Approximate significance of smooth terms:
  18. # edf Ref.df F p-value
  19. #s(depth) 3.691 3.691 43.12 <2e-16 ***
  20. # ---
  21. # Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  22. #
  23. #R-sq.(adj) = 0.0725
  24. #Scale est. = 0.036163 n = 1000
  25.  
  26. ranef(example$lme)$stations[[1]] # extract random intercepts
  27. #se.ranef(example$lme) # extract se of random intercepts - Problem line - doesn't work?
Add Comment
Please, Sign In to add comment