Page 1 of 1

Graphing level 2 variance for random slope cumulative logit model

Posted: Thu Jul 20, 2017 4:30 pm
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

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

Posted: Fri Jul 21, 2017 11:12 am
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.

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

Posted: Fri Jul 21, 2017 2:32 pm
by vivian1234
Thanks, I will have a try!