Page 1 of 1

Issue running MLPowSim in R

Posted: Thu Nov 05, 2020 3:20 pm
by Neuro123
I am currently experiencing an issue trying to run the R output of MLPowSim, 'powersimu.r'. When performing a power analysis for a 1-level model (e.g. the one outlined in the manual section one, p8), the script runs perfectly.

However, I am now trying to replicate the example outlined in the manual section 5.1 (on p113) for R. The R script is generated by MLPowSim, but when running it, I get the error "Error in lmer(modelformula, data, method="ML") : unused argument (method = "ML").
I have tried requesting REML instead, and have tried to change some other parameters deviating from the example given in the manual, but so far I am unsuccessful in bypassing this error message.

I have R version R-3.6.3 installed and running on a Windows platform. Any suggestions as to solving this problem would be highly appreciated!

Re: Issue running MLPowSim in R

Posted: Wed Nov 11, 2020 5:01 pm
by ChrisCharlton
What happens if you just remove the method="ML" statement from the command? i.e.:

Code: Select all

lmer(modelformula, data)
If that doesn't make a difference could you post the associated generated R code?

Re: Issue running MLPowSim in R

Posted: Mon Nov 16, 2020 8:06 am
by Neuro123
Thank you for your suggestion - in the meantime, I'd concluded that the lmer function has been updated relatively recently, and the argument 'method=' is no longer a valid argument to the function. Removing the argument works, but will run the default for the function. From R documentation, I conclude that the argument 'REML=TRUE/FALSE' should allow to specify the method.