Page 1 of 1

How to use predict after a multinomial model

Posted: Tue Sep 24, 2024 8:20 am
by MForseth
Hi
I use runmlwin and have run a multinomial model, and wish to use predict. My model is as follows:
runmlwin iscore cons hybridnum _Itempcat* hybridtempint1-hybridtempint5 rain temprainint1-temprainint5, ////
> level3(id_farm: cons) ////
> level2(flock_id: cons) ////
> level1(idvar) ////
> discrete(dist(multinomial) link(mlogit) denom(cons) basecategory(0)) ////
> nopause igls maxiterations(50)

I have tried the following commands, but they all returned errors as follows:
. predict y,xb outcome(=1)
equation =1 not found
r(303); t=0.01 9:09:01

. predict y,xb
variable cons_1 not found

. predict y,xb outcome(1)
equation 1 not found
r(303); t=0.00 9:18:08

. predict y
variable cons_1 not found
r(111); t=0.00 9:18:29

Any suggestions on how to use predict after a multinomial model?

Re: How to use predict after a multinomial model

Posted: Fri Sep 27, 2024 9:59 am
by ChrisCharlton
Unfortunately we do not offer an automatic way to calculate these predictions. I think that your options are :
  • Remove the nopause option from the command and the once the model is estimated use Model>Customised predictions within MLwiN. You can then copy/paste these results back into Stata.
  • Perform the calculation manually within Stata. There is a simple example of this in the user guide chapter 10 replication materials, but obviously this become a lot more complicated once you add predictors.

Re: How to use predict after a multinomial model

Posted: Fri Oct 11, 2024 7:17 am
by MForseth
Thank you for your reply. I will try an alternative approach.

Re: How to use predict after a multinomial model

Posted: Tue Oct 29, 2024 8:32 am
by matronrocket
Ensure that you are specifying the outcome correctly. In multinomial models, outcomes are typically indexed or labeled. You might need to refer to the exact labels used in your model. Use the command list or describe on your outcome variable to check how it's formatted. If you're predicting probabilities or linear predictions, you might want to use something like: geometry dash lite

Code: Select all

predict y, pr outcome(1) // for probabilities of outcome 1