Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Obtaining Predicted Probabilities using gologit


From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: Obtaining Predicted Probabilities using gologit
Date   Tue, 13 Jun 2006 17:12:27 -0500

At 11:46 AM 6/13/2006, Lisa Powell wrote:
HI,

I am running a gologit model and want to assess the magnitude of the association between one of my independent variables and my outcome variable using the predict option similar to a probit/logit model. I specifically want to set my independent variable to a given value to test varying scenarios for this association. Below is the syntax I used after my gologit model statement:

...
When I ran this I received the following error statement:


predict xb1, equation(mleq1) xb at [promo=1];
option at not allowed
r(198);
I've never seen the "at" option on predict before; it would probably work if you change it to

if promo==1

But, If you use gologit2 (which you can download from SSC) you can save yourself about 15 steps here. gologit2's predict command can compute the probabilities directly, e.g.

gologit2 y promo
predict prob1 prob2 prob3 prob4 prob5 if promo==1

This assumes there are cases where promo really does equal 1.

Here is a more complicated trick.

clonevar newpromo = promo
gologit2 y newpromo x2 x3 x4 x5
replace newpromo = 1
predict prob1 prob2 prob3 prob4 prob5 if e(sample)

This is useful if, say, you want to see what the predicted value for each case would be if promo equaled 1 instead of whatever it does equal.

There are lots of other ways of achieving similar results.



-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: [email protected]
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index