mlwinfitMCMC object fitted values (propensity scores) storage

Welcome to the forum for R2MLwiN users. Feel free to post your question about R2MLwiN here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to R2MLwiN: Running MLwiN from within R >> http://www.bris.ac.uk/cmm/software/r2mlwin/
Post Reply
tetroupploy
Posts: 4
Joined: Wed Dec 20, 2023 8:55 am

mlwinfitMCMC object fitted values (propensity scores) storage

Post by tetroupploy »

I fitted a 2-level binomial model using mcmc. I want to apply predisposition score matching with calculated probability.
How can I convert mlwinfitMCMC fitted propensity scores (the predicted prob of Y for all obs) to numeric objects?

Base R commands are simple: p < model$fitted.values
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: mlwinfitMCMC object fitted values (propensity scores) storage

Post by ChrisCharlton »

You should be able to do this with the overloads that R2MLwiN provides for the generic predict (https://stat.ethz.ch/R-manual/R-devel/l ... edict.html) function. To find more information on the syntax supported in R2MLwiN run:

Code: Select all

help("predict.mlwinfitIGLS")
or:

Code: Select all

help("predict.mlwinfitMCMC")
depending on which estimation method you are using.
Post Reply