Reputation: 9
So, i want to run a repeated measures GLM in RStudio, which I have done...for the most part.... However, Not all dates are showing up in my output (12/1/2015 is missing). Here is part of the output along with my model code so you can see what i mean:
CH4f1 <- glm(GC_CH4.flux~River*Site*Date*Hum.Hol, data = Rdata_w.o_OL_Date, family = gaussian)
summary(CH4f1)
Call:
glm(formula = GC_CH4.flux ~ River * Site * Date * Hum.Hol, family = gaussian,
data = Rdata_w.o_OL_Date)
Deviance Residuals:
Min 1Q Median 3Q Max
-37.307 -2.655 -0.341 0.314 163.247
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 15.5643 75.6869 0.206 0.8372
River -8.4098 55.1093 -0.153 0.8788
Site -3.4776 25.9063 -0.134 0.8933
Date12/1/2016 112.5939 96.6623 1.165 0.2451
Date4/1/2016 -15.4780 96.9954 -0.160 0.8733
Date4/1/2017 -13.8752 94.5132 -0.147 0.8834
Date6/1/2016 12.5824 93.8721 0.134 0.8935
Date6/1/2017 -18.3304 94.5132 -0.194 0.8464
Date9/1/2016 170.2484 95.5697 1.781 0.0759 .
Date9/1/2017 -38.4031 96.7184 -0.397 0.6916
How do I get 12/1/2015 to be one of the dates that shows up in my GLM output?
Upvotes: 0
Views: 230
Reputation: 417
The column Date
is a factor, or is being convert to a factor by glm
.
By default, glm
uses the treatment contrast for factors, also called Dummy Encoding. This means that (Intercept)
is the coefficient for the first level, 12/1/2015
.
For the other dates, those coefficients are changes from 12/1/2015
. For example, the intercept for 6/1/2017
is actually (Intercept) + Date6/1/2017 = 15.5643 + ( -18.3304)
.
I could give more specific help if you provided a reproducible example.
Upvotes: 2