Predicted Probability for ML Ordinal Model

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin 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 runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
vivian1234
Posts: 30
Joined: Tue Apr 12, 2016 10:54 am

Predicted Probability for ML Ordinal Model

Post by vivian1234 »

Hi,

I have obtained the estimates for both fixed and random effects of my model and I've used the following syntax to output the MLwiN file:

Code: Select all

saveworksheet(output.wsz)
Since I've created dummy variables in my original data for all categorical variables, the output MLwiN file contains these dummy variables rather than the categorical variables. I want to obtain the predicted probability for the categorical variables, so I tried to use the MLwiN software to calculate the predicted probability for the dummy variables, but the system clashed.

I want to know if this is an appropriate method to obtain the predicted probability (by converting back to MLwiN file)? If yes, what should I do in the MLwiN software? If no, what suggestions would you recommend.

Thanks,
Vivian
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Predicted Probability for ML Ordinal Model

Post by GeorgeLeckie »

Hi Vivian,

Yes. What you have done should work. Please can you send through more details about the MLwiN crash.

Alternatively, the more "runmlwin" approach would be to calculate these predicted probabilities in Stata. See

http://www.bristol.ac.uk/cmm/media/runm ... e_Model.do

Best wishes

George
vivian1234
Posts: 30
Joined: Tue Apr 12, 2016 10:54 am

Re: Predicted Probability for ML Ordinal Model

Post by vivian1234 »

Hi George,

I have figured out why the MLwiN crash. However, I want to ask for some clarifications to make sure I did not do it in a wrong way.

Suppose I have 3 dummy variables (edu2, edu3 and edu4) for the categorical variable edu (with 4 categories) and I want to calculate the predicted probability for the four dummies on the outcome (with 3 categories: very low, low, some (high is used as referenced), so this is what I'm doing now:
  1. Select customised predictions from model menu
  2. For dummy variable edu2, I change the range to 2 values (0 and 1)
  3. For dummy variable edu3, I change the range to 2 values (0 and 1)
  4. For dummy variable edu4, I change the range to 2 values (0 and 1)
  5. I leave other variables at their means (even they are dummies)
  6. Check Median under Predictions to
  7. Click Fill Grid and click Predictions
The resulting prediction table has 24 rows.

I'm not sure which rows are the cumulative predicted probabilities that I need. Should I only consider these 12 rows?

Code: Select all

outcome	edu2.pred	edu3.pred	edu4.pred	median.pred
v low		  0				0				0			0.404825
low		    0				0				0			0.909902
some			0				0				0			0.993264
v low		  1				0				0			0.454619
low		    1				0				0			0.925090
some			1				0				0			0.994399
v low		  0				1				0			0.343601
low		    0				1				0			0.886221
some			0				1				0			0.991421
v low		  0				0				1			0.341411
low		    0				0				1			0.885214
some			0				0				1			0.991341
Do the first three rows represent the (cumulative) predicted probability for edu1? the 4th-6th row represent the (cumulative) predicted probability for edu2 and etc.?

Thank you very much.

Regards,
Vivian
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Predicted Probability for ML Ordinal Model

Post by GeorgeLeckie »

Hi Vivian,

As far as I can see what you have done looks correct. I am guessing that the other 12 rows correspond to scenarios where two or more dummies are switched on simultaneously which of course do not make sense in your example. So yes ignore these 12 other rows.

Best wishes

George
Post Reply