Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Calculating predicted probabilities at a given value of one of the independent variables


From   Richard Williams <richardwilliams.ndu@gmail.com>
To   statalist@hsphsun2.harvard.edu, <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Calculating predicted probabilities at a given value of one of the independent variables
Date   Wed, 26 Oct 2011 19:56:51 -0500

At 06:06 PM 10/26/2011, Maria Ana Vitorino wrote:
Dear Statalist users,

I would like to calculate some predicted probabilities after fitting a
multinomial logit model (asclogit). But, the twist is that I would
like to calculate these fitted values for a given level of one of the
independent variables. Namely, I would like to set one of the Xs to
zero when computing the predicted probability (but not in the
estimation).
What would be the best way of going about this? Would it make sense to
do it in 2 steps? In the first step use  "predict xb" and in the
second step remove the component of xb that I'm not interested and
calculate the probability using "gen" and the logit formula?
Or is there a better way?

How about something like this?

webuse sysdsn1, clear
clonevar xmale = male
mlogit insure age i.xmale nonwhite i.site
predict p1 p2 p3
replace xmale = 0
predict pp1 pp2 pp3

In other words, clone the variable of interest (or otherwise make sure that you don't zap the original values), run your model, and then change the value of the cloned variable to whatever you want.

Depending on what exactly it is you want (e.g. do you need all the individual predictions, or just some overall average prediction?) you might be able to do this with margins as well.

Incidentally, I'd be hesitant to say there is some component of xb I am not interested in. On the other hand, I might be interested in the predicted probabilities when x is equal to some value. In this case I am setting the gender variable equal to female.


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu
WWW:    http://www.nd.edu/~rwilliam

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index