Statalist The Stata Listserver


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

RE: st: matrix product in stata after mvprobit


From   Maarten buis <[email protected]>
To   [email protected]
Subject   RE: st: matrix product in stata after mvprobit
Date   Sat, 21 Apr 2007 20:59:19 +0100 (BST)

There is something seriously wrong with your code: The fact that you
have called -sum- doesn't mean that the variable will now contain the
mean, as you appear to think. The mean is stored in r(mean) and will
change every time you will call -sum-. So you will have to store it,
e.g. in a local or a scalar, and feed that to norm. 

The formula for the marginal effect is probably something like:
norm(xb)*norm(-xb)*_b[whatever]. However I don't know if the
correlation between error terms is going to spoil that formula, so
you'd better derive it yourself (it's the first derivative)

Hope this helps,
Maarten

--- stata_user stata_user <[email protected]> wrote:

> Thanks a lot Maarten,
> 
> I found your paper very interesting, I  have followed your suggestion
> .
> 
> Since I  am interested on the change in the marginal  probabilities
> from 
> mvprobit , for example for one of my independent  binary  variables ,
> called 
> DM, I have used the following syntax to obtain the the 3 marginal 
> probailities for my 3 dependent binary variables (bn_1,bn_2 and bn_3)
> 
> *------------------------------DM==0-----------------*
> 
> mvppred xb_DM0  if DM ==0,xb
> 
> sum  xb_DM01 if e(sample)
> sum  xb_DM02 if e(sample)
> sum  xb_DM03 if e(sample)
> 
> *------------------------------DM==1-----------------*
> 
> mvppred xb_DM1  if DM ==1,xb
> 
> sum  xb_DM11 if e(sample)
> sum  xb_DM12 if e(sample)
> sum  xb_DM13 if e(sample)
> 
> *--------------Marginal probabilities for DM =0 and
> DM=1-----------------*
> *bn_1,bn_2 and bn_3 are the 3 binary variables
> *For bn_1
> gen bn_01 = norm(xb_DM01)
> gen bn_11 = norm(xb_DM11)
> 
> *For bn_2
> gen bn_02 = norm(xb_DM02)
> gen bn_12 = norm(xb_DM12)
> 
> *For bn_3
> gen bn_03 = norm(xb_DM03)
> gen bn_13 = norm(xb_DM13)
> 
> However I have noticed that even if  the  3 beta coeffecients of DM
> were all 
> positives, the change on the probabilites from DM=0 to DM=1 (having
> all 
> other variables constant at their mean values) were either positive
> or 
> negative, is this make sense ?
> 
> The second point is how to obtain the change for a continuous
> variable ?
> 
> Kind regads,
> 
> Sami
> 
> 
> >From: Maarten buis <[email protected]>
> >Reply-To: [email protected]
> >To: [email protected]
> >Subject: RE: st: matrix product in stata after mvprobit
> >Date: Wed, 18 Apr 2007 09:04:02 +0100 (BST)
> >
> >--- stata_user stata_user <[email protected]> wrote:
> > > I have tried mvppred, but I have noticed that I can have
> predicted
> > > values for xb , p and other statistics  only for the values of
> the
> > > x's (independent variables) that are already in my data.
> > >
> > > When I specify with the " if" statement , that I want the
> predicted
> > > for the means of the x�s, I have a message saying  � no
> >observations�.
> > >
> > > I do not know if it is possible to get the predicted values on
> the
> > > mean values of the x's (independent variables)
> >
> >You can use the fact that the mean linear predictor is the linear
> >predictor at mean values of x. Note, however that the mean
> probability
> >is not the probability at mean values of x. See:
> >http://home.fsw.vu.nl/m.buis/wp/logit_adjust.html .
> >
> >So what you want to do is: 1) use predict to create the linear
> >predictors, 2) sumarize them (don't forget to ensure that you are
> doing
> >it on the same sample by adding: if e(sample)), and 3) plug the
> means
> >into the formula for creating probabilities.
> >
> >However, comparing mean predicted probabilities is in this case
> easier,
> >and in many cases theoretically nicer: you are comparing a typical
> >predicted probability for men with a typical predicted probability
> for
> >women, instead of comparing predicted probability for men who have
> >typical values on the other explanatory variables with predicted
> >probabilites for women who have typical values on the other
> explanatory
> >variables.
> >
> >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/
> >-----------------------------------------
> >
> >
> >       ___________________________________________________________
> >Yahoo! Mail is the world's favourite email. Don't settle for less,
> sign up 
> >for
> >your free account today 
>
>http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html
> >*
> >*   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/
> 
> _________________________________________________________________
> Get Hotmail, News, Sport and Entertainment from MSN on your mobile.  
> http://www.msn.txt4content.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/
> 


-----------------------------------------
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/
-----------------------------------------


      ___________________________________________________________ 
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for
your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html 
*
*   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