Page 1 of 1

Saving Level 2 Residuals When Running Multiple Chains

Posted: Tue Feb 15, 2022 4:43 am
by krcassiday
Hello,

I am running several models in R2MLwiN. When I run the models with 1 MCMC chain, I am able to use the resi.store.levs = 2 argument as shown below:

Code: Select all

(mymodel3 <- runMLwiN(math ~ 1 + y + z + (1 | unique_s1) + (1 | student_id), estoptions = list(EstM = 1, mcmcMeth=
                                               list(burnin=500, iterations=5000, thinning=1),
                                               mm = list(list(mmvar = list("s1", "s2", "s3", "s4"), 
                                               weights = list("w1", "w2", "w3", "w4")), NA), resi.store = TRUE, 
                                               resi.store.levs = 2), data = dataset))
However, when I try to add in more than one chain using nchains = 2, I get the error "Error in coda::mcmc.list(resichainslist) : Arguments must be mcmc objects". The model only seems to run if I remove the resi.store.levs = 2 argument.

I need to be able to save the level 2 residuals and ideally I would like to run more than one chain. Is this possible? Any help would be greatly appreciated. Thank you!

Re: Saving Level 2 Residuals When Running Multiple Chains

Posted: Mon Feb 21, 2022 4:34 pm
by ChrisCharlton
Thanks for letting us know about this, the error appears to be due to a bug. I have made a fix in the development version of the package which once the r-forge mirror (https://github.com/r-forge/r2mlwin/tree/master/R2MLwiN) has synchronised you should be able to install with the commands:

Code: Select all

library(devtools)
install_github("rforge/r2mlwin", subdir="R2MLwiN")

Re: Saving Level 2 Residuals When Running Multiple Chains

Posted: Tue Mar 01, 2022 3:01 pm
by krcassiday
Thank you so much for your reply. I will install the updates! I appreciate your help.