• Register
1 vote

Problem :

I have my data as this the ticks feed on three of the groups of treated mouse’s and compare whether my treatment has the effect on ticks the bacteria load.

When I tried to make the mixed model like below:

lmer.model01 = lmer(log10.load ~ treat + (1|mouse.id/tick.id))

My screen shows me the error as below :

Error: number of levels of each grouping factor must be < number of observations

What must have happened and how can fix this error?

6 5 3
7,540 points

1 Answer

0 votes

Solution :

If you have only the single measurement per tick then you must leave your explicit mouse.id:tick.id grouping variable out of your model, i.e. use the log10.load ~ treat + (1|mouse.id). Alternatively, if this is the nested design then each mouse gets one of the treatment, each tick is fed on the single mouse and multiple ticks per mice you could also follow the Murtaugh 2007 "Simplicity and complexity in ecological data analysis" Ecology 88 and simply you need to compute the average load per mouse, then you can use the simple lm(log10.load~treat,data=aggregated_data). If you are insisting on fitting your model the way it is then you can use the  control=lmerControl(check.nobs.vs.nlev="ignore"), but if you ask me then I don't advise it.

9 7 4
38,600 points

Related questions

0 votes
1 answer 517 views
Problem : I face folowing error when I run an ANOVA on R in model.response(mf, "numeric") : using type = "numeric" with a factor response will be ignored
asked Nov 12, 2019 peterlaw 6.9k points
0 votes
1 answer 89 views
Problem: I have very good knowledge of r, ggplot and unix. I am now a days trying to analyze the dataset of the GSR values. I had first transformed my all the required unix values into the readable data and after that I created the plot of my GSR values in the ... . But I had already supplied the origin when I tried to transform my unix into the readable data and also again in the ggplot code.
asked Jul 27 Raphael Pacheco 4.9k points
1 vote
1 answer 359 views
Problem: I have limited knowledge of R and ggplot. I have recently written a function and trying to run the function as shown below: ggplot(datfr, aes(x = dat1[1:951,], y = dat2[1:951,])) + geom_point() After executing above function I am facing below error: Don't ... and when I try to use nrow on my two datasets it again returns the same number of rows. How can I fix above ggplot related error.
asked May 26 Martin K 6.6k points