## weight age.years lat site
## 1 12615.13 41 2.690077 Site 1
## 2 12539.55 50 2.974857 Site 2
## 3 13753.97 21 -4.868759 Site 1
## 4 17269.26 50 -28.437431 Site 2
## 5 16945.27 16 -26.414605 Site 1
## 6 14723.24 39 -11.392111 Site 2
first = glm(weight~age.years+site+age.years:site
second = glm(weight~age.years+site)
third = glm(weight~age.years*site)
fourth = glm(weight~poly(age.years,2)+site
glm(weight~age.years+site)
glm(weight~age.years+site)
glm(weight~age.years*site)
dat$age.yeras.sc = scale(dat$age.years,center=TRUE, scale=TRUE)
summary(glm(weight~age.yeras.sc*site,data=dat))
##
## Call:
## glm(formula = weight ~ age.yeras.sc * site, data = dat)
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 14574.8 241.9 60.245 < 2e-16 ***
## age.yeras.sc -706.4 263.3 -2.682 0.00861 **
## siteSite 2 -188.1 342.0 -0.550 0.58367
## age.yeras.sc:siteSite 2 1173.1 347.5 3.375 0.00107 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for gaussian family taken to be 2908337)
##
## Null deviance: 313494594 on 99 degrees of freedom
## Residual deviance: 279200364 on 96 degrees of freedom
## AIC: 1778
##
## Number of Fisher Scoring iterations: 2