[R-sig-ME] Different number of observations in variables of glmer

Paul Johnson p@ul@john@on @ending from gl@@gow@@c@uk
Thu Jun 14 20:44:14 CEST 2018


The r.squaredGLMM function in MuMIn tries to add an observation-level random effect term if it doesn’t find one — I suspect this is where your error is coming from. It’s debatable whether this is a good idea (on the one hand it’s often a good idea to add an OLRE, but I think it would be better to give the user the choice). 

I suggest using the rsquared function in piecewiseSEM. A major update has just been uploaded to CRAN, which includes extensions of R-squared to models not previously covered:
https://cran.r-project.org/web/packages/piecewiseSEM/index.html

> On 13 Jun 2018, at 16:35, Cueva, Jorge <jorge.cueva using tum.de> wrote:
> 
> Hello, I am trying fit a glmer where the fixed variables has a different number of observations (72 and 60). With the models where the variables has the full observations I don�t have problems but yes in the models where some of its variables has 60 observations. In the second case,  all work well until I compute the R2m and R2c and I get the error "fitting model with the observation-level random effect term failed. Add the term manually", so, when I ingress the observation level the AIC increase 2 points, and miss 1 df. Please how I might work in these cases??
> 
> First case...
> glmer(Spp~1+Mth.Prec+Soil.depth+Drainage+(1|Cluster),data = VariabRL,family=poisson,glmerControl(optimizer="bobyqa", optCtrl = list(maxfun = 2e5)))
> 
> Second case...
> glmer(Spp~1+Mth.Prec+Soil.depth+Drainage+(1|Cluster)+(1|X),data = VariabRL,family=poisson,glmerControl(optimizer="bobyqa", optCtrl = list(maxfun = 2e5)))
> 
> Mth.Prec = 72 observations
> Soil.depth and Drainage = 60 observations
> X = observation level
> 
> Thanks a lot
> 
> Jorge Cueva Ortiz
> Ing. Forestal
> ECU: 0993085161
> GER: 0049 1631327886
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



More information about the R-sig-mixed-models mailing list