Saving Level 2 Residuals When Running Multiple Chains
Posted: Tue Feb 15, 2022 4:43 am
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:
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!
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))
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!