Skip to content
Prev 6943 / 20628 Next

No data for 1 interaction combination: problem in R not in Genstat

Dear list member
I have a similar problem like Roger, but more complex...
I have two interaction terms that are unoccupied and one interaction term that is complete. I would like to test all in the same linear mixed-effects model.
?
my data is the following:
?
?str(mydata)
'data.frame':?? 22 obs. of? 12 variables:
?$ hare???????? : chr? "AF" "AH" "AH" "AH" ...
?$ period?????? : num? 1 2 3 4 5 15 17 6 16 18 ...
?$ mcp????????? : num? 11.22 4.6 6 8.11 10.51 ...
?$ k_href?????? : num? 19.25 6.21 7.94 12.14 11.61 ...
?$ k_hnew?????? : num? 18.36 7.89 9.83 9.84 12.57 ...
?$ activity???? : chr? "a-na" "a-na" "a-na" "a-na" ...
?$ month??????? : num? 5 7 7 7 7 7 7 7 7 7 ...
?$ sexfactor??? : Factor w/ 2 levels "f","m": 2 1 1 1 1 1 2 1 1 1 ...
?$ monthfactor? : Factor w/ 4 levels "5","7","8","9": 1 2 2 2 2 2 2 2 2 2 ...
?$ harvestfactor: Factor w/ 2 levels "harvest","post_harvest": 1 1 1 1 1 1 1 2 2 2 ...
?$ monthsex???? : Factor w/ 6 levels "f:7","f:8","f:9",..: 4 1 1 1 1 1 5 1 1 1 ...
?$ monthharvest : Factor w/ 5 levels "harvest:5","harvest:7",..: 1 2 2 2 2 2 2 3 3 3 ...
?
I would like to test the effect of harvest, sex and season (month) on the home-range size (k_hnew)?of hares.

monthsex and monthharvest are the interaction terms with unoccupied levels. Another interaction term I would like to include in my analysis is sex*harvest (the random factors?are week and hare).
I tried the following mixed-effects model:
?
model_h_r<-lmer(sqrt(k_hnew)~factor(sex)*factor(harvest)+monthsex+monthharvest+(1|week)+(1|hare),data=mydata)
object=pvals.fnc(model_h_r, nsim = 10000)
object$fixed
?
I get the error message:
error?in mer_finalize(ans) : Downdated X'X is not positive definite, 8.
?
If I include only one interaction term in the linear mixed-effects model , I don't get any error message!

model_h_r_monthsex<-lmer(sqrt(k_hnew)~monthsex+(1|week)+(1|hare),data=mydata)
object=pvals.fnc(model_h_r_monthsex, nsim = 10000)
object$fixed
?
model_h_r_harvest_week<-lmer(sqrt(k_hnew)~factor(sex)*factor(harvest)+(1|week)+(1|hare),data=mydata)
object=pvals.fnc(model_h_r_harvest_week, nsim = 10000)
object$fixed
?
model_h_r_monthharvest<-lmer(sqrt(k_hnew)~monthharvest+(1|week)+(1|hare),data=mydata)
object=pvals.fnc(model_h_r_monthharvest, nsim = 10000)
object$fixed
?
I woul very much appreciate your help!
Thank you,
St?phanie