Graphing level 2 variance for random slope cumulative logit model

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
vivian1234
Posts: 30
Joined: Tue Apr 12, 2016 10:54 am

Graphing level 2 variance for random slope cumulative logit model

Post by vivian1234 »

Hi,

I have another question about graphing the level 2 variance for a random slope cumulative logit model. I was reading https://www.cmm.bristol.ac.uk/forum/vie ... 9477ba83f4 and it was mentioned that one way to do this would be to create a new dataset, then pass this dataset to the predict fucntion with the newdata parameter. Since the post was from last year, I would like to know if this option works with the current version of R2MLwiN? If yes, how does it actually work? I am quite new to R, that's why I am a little bit lost.

Thanks again.

Regards,
Vivian
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: Graphing level 2 variance for random slope cumulative logit model

Post by ChrisCharlton »

Creating predictions with new datasets should now work. To do this you create a data frame with the same variables names as the data used to fit the model and then put the name of this data frame as the newdata parameter of the predict command.

As you are trying to plot the variance I would suggest that you instead look at chapter 7 of the MLwiN user's guide, along with the R replication materials (http://www.bristol.ac.uk/cmm/media/r2ml ... ide07.Rout), as this gives examples of plotting variance functions.
vivian1234
Posts: 30
Joined: Tue Apr 12, 2016 10:54 am

Re: Graphing level 2 variance for random slope cumulative logit model

Post by vivian1234 »

Thanks, I will have a try!
Post Reply