I have activity budget data from wild orangutans for which I am investigating if there is a difference in the time they spend feeding, resting and travelling before a forest fire event and after the fire event. I am running a linear mixed effects model with the minutes spent feeding on a particular day as my response variable (with the number of minutes the orangutan is awake as an offset). Fire period and age/sex class are fixed effects, and orangutan ID is the random effect. I have 2 levels of the fire_time factor ('pre' and 'post'), 4 levels of the Age_Sex factor ('SAF', 'FM', 'UFM', 'Adolescent'), 47 orangutans for the random effect and a total of 817 datapoints in this dataset.
My dataframe looks like this:
head(F)
Follow_num Ou_name Date Month fire_time Age_Sex Primary_Act AP_obs minutesin24hr Perc_of_waking_day Perc_of_24hr
1 2029 Teresia 2011-10-04 Oct-11 pre SAF Feeding 625 310 49.60 21.53
5 2030 Teresia 2011-10-05 Oct-11 pre SAF Feeding 610 285 46.72 19.79
9 2032 Teresia 2011-10-09 Oct-11 pre SAF Feeding 620 340 54.84 23.61
13 2034 Teresia 2011-10-11 Oct-11 pre SAF Feeding 670 405 60.45 28.13
17 2038 Victor 2011-10-27 Oct-11 pre FM Feeding 675 155 22.96 10.76
21 2040 Nero 2011-11-03 Nov-11 pre FM Feeding 640 295 46.09 20.49
The code for my model is as follows:
library(lme4)
lmer(minutesin24hr ~ Age_Sex + fire_time + (1|Ou_name), data = F, offset = AP_obs, REML = TRUE, na.action = "na.fail")
When I run this model using the lmerTest
package to check degrees of freedom and p-values, it seems I have very large degrees of freedom for the levels that are significant (see Age_SexSAF and fire_timepre).
lmerTestmodel <- lmerTest::lmer(minutesin24hr ~ Age_Sex + fire_time + (1|Ou_name), data = F, offset = AP_obs, REML = TRUE, na.action = "na.fail")
REML criterion at convergence: 9370.7
Scaled residuals:
Min 1Q Median 3Q Max
-3.8955 -0.6304 0.1006 0.7141 2.3109
Random effects:
Groups Name Variance Std.Dev.
Ou_name (Intercept) 1636 40.44
Residual 5460 73.89
Number of obs: 817, groups: Ou_name, 47
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) -188.614 14.711 26.765 -12.821 6.14e-13 ***
Age_SexFM -20.297 17.978 24.696 -1.129 0.2698
Age_SexSAF -25.670 11.799 318.473 -2.176 0.0303 *
Age_SexUFM 12.925 22.806 27.319 0.567 0.5755
fire_timepre -29.558 6.214 709.117 -4.757 2.38e-06 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) Ag_SFM A_SSAF A_SUFM
Age_SexFM -0.741
Age_SexSAF -0.505 0.374
Age_SexUFM -0.598 0.480 0.302
fire_timepr -0.298 -0.015 0.149 0.034
I imagine these large degrees of freedom are making the p-values significant so am sceptical about the model. Why is it I am getting such large degrees of freedom on just these two levels? There are more data in the Age_SexSAF and fire_timepre levels but it doesn't seem normal to me. I am planning on reporting the estimate, confidence intervals and p-values in my thesis but am concerned about reporting if these degrees of freedom are wrong.
Apologies if this may be a naïve question, this is the first time I have ventured into mixed effects models. Any advice is greatly appreciated, thanks!