I'm running into an issue where I receive the following error when trying to use powerSim to estimate power for my multilevel model. All my variables including DV and IV are continuous variables. Here are my codes for my model and powerSim
#My model:
m1<- lmer(a_p2relsat ~ (Avoidance_centering + Anxiety_centering) * Identification_centering+
(1|ID), control = lmerControl(optimizer = "bobyqa"),data = S2)
#changing effect size of ['Avoidance_centering:Identification_centering'] to 0.2:
model_size <- m1
fixef(model_size) ['Avoidance_centering:Identification_centering'] <- 0.2
# performing power analysis using powerSim()
power_m1 <- powerSim(model_size, test=fcompare(a_p2relsat~Avoidance_centering:Identification_centering),
nsim=400)
power_m1
#the output for power_m1 is listed below:
>power_m1
Power for model comparison, (95% confidence interval):
0.00% ( 0.00, 0.92)
Test: Likelihood ratio
Comparison to a_p2relsat ~ Avoidance_centering:Identification_centering + [re]
Based on 400 simulations, (0 warnings, 400 errors)
alpha = 0.05, nrow = NA
Time elapsed: 0 h 0 m 5 s
#I checked lastResult()$errors, and the output showed:
>lastResult()$errors
stage index message
1 Simulating 1 new levels detected in newdata: 120, 125, 336, 347
2 Simulating 2 new levels detected in newdata: 120, 125, 336, 347
3 Simulating 3 new levels detected in newdata: 120, 125, 336, 347
4 Simulating 4 new levels detected in newdata: 120, 125, 336, 347
5 Simulating 5 new levels detected in newdata: 120, 125, 336, 347
6 Simulating 6 new levels detected in newdata: 120, 125, 336, 347
7 Simulating 7 new levels detected in newdata: 120, 125, 336, 347
8 Simulating 8 new levels detected in newdata: 120, 125, 336, 347
9 Simulating 9 new levels detected in newdata: 120, 125, 336, 347
10 Simulating 10 new levels detected in newdata: 120, 125, 336, 347
I couldn't debug this issue. Is there something wrong in my code that is leading to the error messages? Does anyone have any idea about this ? Many thanks in advance for your time!