Hello:
I am running a simulation in which need to pull out the coefficients of a
multiply imputed object for each simulation.
The coefficientscould be called using the following command:
mi.txt.i@imp$Chain1$cont.y.obs@model$coefficients
THis gives me the coefficients for the first imputation (Chain 1). What I
would like to do, however, is pull out the coefficients for all Chains but
cannot figure out how.In other words, I want the coefficients from
Chain1-Chain500 saved in a matrix.
mi.txt.i@imp$Chain1$cont.y.obs@model$coefficients
mi.txt.i@imp$Chain2$cont.y.obs@model$coefficients
mi.txt.i@imp$Chain3$cont.y.obs@model$coefficients
...
mi.txt.i@imp$Chain500$cont.y.obs@model$coefficients
I tried using paste:
for (i in 1:500){
s=paste("Chain",i)
mi.txt.i@imp$s$cont.y.obs@model$coefficients
...}
But that did not work. I also tried other variations of this looping with
no avail.
Thoughts on how to use a loop to call coefficients?
Thanks,
--
Andrea Lamont, MA
Clinical-Community Psychology
University of South Carolina
Barnwell College
Columbia, SC 29208
Please consider the environment before printing this email.
CONFIDENTIAL: This transmission is intended for the use of the
individual(s) or entity to which it is addressed, and may contain
information that is privileged, confidential, and exempt from disclosure
under applicable law. Should the reader of this message not be the intended
recipient(s), you are hereby notified that any dissemination, distribution,
or copying of this communication is strictly prohibited. If you are not
the intended recipient, please contact the sender by reply email and
destroy/delete all copies of the original message.
[[alternative HTML version deleted]]