Open Code3020 opened 8 months ago
You've passed powerSim
two test specifications: fixed("x","kr")
and test = fcompare(~ sleep_quality * dep01)
. Because you've named the second one, the first is being used as the sim
argument which is causing the errors.
Thanks for your quick reply! I tried several single tests but I still got the same amount of errors and the same output.
Here are the ones I've tried:
fixed("kr")
, test = fixed("sleep_quality")
, and test = fcompare(~ sleep_quality * dep01)
You can access the error log using sim_p$errors
.
All the error messages are the same
non-conformable arrays
I don't have access to your df1
data frame, but that error often comes up if there is missing data.
Thanks for the hint!
Only one variable used in the formula had missing data so I subsetted the data by removing the rows containing these missing data. But now I got 1000 warnings and 1000 errors per 1000 simulations. The warnings are
boundary (singular) fit: see help('isSingular')
I guess that it's because I cluster-mean standardized the continuous independent variables.
Any suggestions or thoughts?
If you are getting errors those are what you should focus on.
Hi,
In the simulation I tried to run based on the model output of a model I tested, there were lots of errors - in 1000 simulations, there were 1000 errors.
Here are the codes:
b = c(2.66,.11,-.65,-.03,.003,-.01)
V1 <- 1.16
V2 <- matrix(c(1.16,0,0,.02),2)
s <- .74
model1 <- makeLmer(pos_mean ~ sleep_quality * dep01 + Gender + Age + (1 + sleep_quality|ID), fixef=b, VarCorr=V2, sigma=s, data=df1) print(model1)
sim_p <- powerSim(model1, fixed("x","kr"), test = fcompare(~ sleep_quality * dep01), alpha=.05, nsim=1000)
print(sim_p)
Here is the output:
Many thanks for your help!