Statalist The Stata Listserver


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

Re: st: prgen question after logit


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: prgen question after logit
Date   Mon, 9 Apr 2007 21:27:14 +0100 (BST)

> At 02:53 PM 4/9/2007, S J wrote:
> >I estimate a model of the form
> >
> >xi: logit y x1 i.x2
> >
> >Then I attempt to do the below:
> >prvalue, x(x2=0) rest(mean)
> >prvalue, x(x2=1) rest(mean)
> >
> >But I get an error message:
> >x1 not rhs variable
> >invalid syntax
> >r(198);
> >
> >Any ideas? Is it that I can't use the xi route for
> >specifying categorical rhs's and then use prvalue?

--- Richard Williams <[email protected]> wrote:
> x2 isn't actually a variable in the equation.  Dummies created from 
> x2 are.  So, I think you need to create the dummies 
> yourself.  Although, if x2 is already a dummy var, you don't need xi 
> in the first place.
 
You can use -prvalue- directly after -xi- only you have to know how the
new variables -xi- creates are named. See, example below:

*-------------- begin example -----------
sysuse auto, clear
recode rep78 1/2=3
xi: logit foreign i.rep78 price mpg

/*probability for rep78==1-3*/
prvalue ,x(_Irep78_4=0 _Irep78_5=0) rest(mean)

/*probability for rep78==4*/
prvalue ,x(_Irep78_4=1 _Irep78_5=0) rest(mean)

/*probability for rep78==5*/
prvalue ,x(_Irep78_4=0 _Irep78_5=1) rest(mean)
*--------------- end example -----------
(For more on how to use examples I sent to the Statalist, see:
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten 


-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
*
*   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