mixedpower does not work for GLMM, only for LMM; error: "dim(X) must have positive length"

Viewed 25

I have troubles computing a power analysis for a GLMM model. The code is:

`power <- mixedpower(model = glm_model, data= df, 
fixed_effects=c("task","height","length","color"), # fixed effects
simvar = "subject", # random effects
steps = c(20,40,60), # sample sizes to simulate
critical_value = 2,# reflects alpha level of 5%
SESOI = effects, # smallest effect size of interest
n_sim = 100)`

I use Gamma distribution with a log link. The errors I get are:

`"Simulations for step  20are based on  0  successful single runs"
Error in apply(store_simulations, MARGIN = 1, FUN = mean, na.rm = T) : 
  dim(X) must have positive length
In addition: Warning messages:
1: In vcov.merMod(object, use.hessian = use.hessian) :
  variance-covariance matrix computed from finite-difference Hessian is
not positive definite or contains NA values: falling back to var-cov estimated from RX`

However, if I use the same model as a linear model, it works. What could be the reason for that?

0 Answers
Related