I have a dataset containing male and female data. I have the response variable metabolic rate, and several predictors (Behaviour, Temperature 1, Temperature 2, Activity, Sex, Body Size, and Body Mass).
First, I conduct the GLMM using an identity link on male and female combined data:
glmer(log(Metabolic_Rate)~ Temperature.1 + Behaviour * Temperature.2 + Sex + Activity + Body_Size + Body_Mass + (1|Week), data= AMRdata, family = Gamma(link = 'identity'))
And then run model simplification. The model works just fine and I have no error messages.
Then, I separate the data by sex and run the model on just female data:
females<-subset(AMRdata,Sex=="F")
glmer(log(Metabolic_Rate)~ Temperature.1 + Behaviour * Temperature.2 + Activity + Body_Size + Body_Mass + (1|Week), data = females, family = Gamma(link = 'identity'))
I am greeted by the error message:
Error in pwrssUpdate(pp, resp, tol = tolPwrss, GQmat = GQmat, compDev = compDev, :
(maxstephalfit) PIRLS step-halvings failed to reduce deviance in pwrssUpdate
Removal of Temperature.2 takes removes this error, but I really need to keep it in the model.
Does anyone have any suggestions as to how to remove the error?
I'm using lme4 version 1.1.21, and the female model doesn't work if I don't use the log transformation, either. I have tried using a log link, but I get the same error message.
Some data:
structure(list(Metabolic_Rate = c(8.79514591, 16.71840387, 14.1932374,
10.90741585, 10.7436911, 14.97469781, 19.88267242, 12.43274774,
15.12038794, 11.84916117, 11.05467852, 19.53495917, 12.14440531,
12.09564168, 6.78392472, 10.51570692, 8.527792046, 8.731880804,
10.71404367), Behaviour = c(23L, 17L, 14L, 7L, 99L, 78L, 90L,
1L, 9L, 29L, 76L, 66L, 43L, 36L, 13L, 4L, 82L, 14L, 59L), Temperature.1 = c(21.9,
21.7, 18.52, 19.85, 20.45, 20.54, 21.7, 22, 21.32, 21.4, 21.44,
22.1, 22.22, 22.25, 20.43, 20.9, 21.63, 21.2, 21.52), Temperature.2 = c(17.5,
15.6, 12.5, 19.8, 16.6, 20.8, 21.4, 21.9, 21, 21.3, 20.5, 22,
22.1, 22.2, 20.6, 21.2, 21.9, 21.1, 21.5), Activity = c(39.54664352,
66.75914352, 40.85949074, 44.8505787, 37.20023148, 69.75388889,
72.43981481, 70.42199074, 20.71481481, 77.27662037, 62.21712963,
93.22673611, 82.39247685, 89.42141204, 35.35729167, 31.97777778,
74.65821759, 40.80590278, 54.3755787), Sex = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L), .Label = c("F", "M"), class = "factor"), Body_Size = c(7.6,
5.8, 7.9, 7.6, 8, 7.5, 7.9, 7.6, 7.2, 7.8, 7.8, 7.4, 7.1, 8.4,
6, 7.9, 7.2, 7, 8.2), Body_Mass = c(0.747, 0.55, 0.76, 0.673,
0.691, 0.683, 0.689, 0.789, 0.6, 0.612, 0.637, 0.511, 0.582,
0.603, 0.408, 0.527, 0.666, 0.483, 0.602), Week = c(1L, 1L, 2L,
3L, 3L, 3L, 3L, 4L, 5L, 6L, 6L, 8L, 8L, 8L, 8L, 9L, 9L, 9L, 10L
)), class = "data.frame", row.names = c(NA, -19L))