Statalist


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

st: Plotting predicted probabilities/marginal effects after -bioprobit-


From   Ekaterina Selezneva <eka.selez@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Plotting predicted probabilities/marginal effects after -bioprobit-
Date   Fri, 19 Sep 2008 17:37:47 +0200

Dear Stata-listers,

My problem is the following. I have estimated a bivariate ordered
probit with help of -bioprobit-.    If I predict a joint probability
of some couple of outcomes with help of -predict p44,
outcome(4,4)-, I have some "fountain"-like picture.

So I wanted to create a graph, showing
how this joint probability would changes if all the  continuous
explanatory variables are fixed as their means, and only one variable
changes. This "changing" variable is presented only in
the first equation.

I was trying to calculate the predictions manually,  and then to make
a scatter plot of the probability predicted vs. my variable of
interest. But what I receive is a kind of "cloud" I cannot interpret
in any way.

WHERE I'M WRONG??

I would appreciate any hint.

Ekaterina


#delimit;
global cont_common "child06 child718 nomale nofem nold  ownhouse";
global cont_own "age age2 had_prob ";
global cont_partn "age_p age_p2 had_prob_p ";
global timereg "i.geo i.year";

 xi:  bioprobit (satlif0= lwh_n  lnmarketh_w  lratio_wage ltotexprcut $cont_own $cont_common $timereg) 
(satlif0_p= lwhn_p lnmarkethw_p  lratio_wage ltotexprcut $cont_partn $cont_common $timereg)
 if gender==2&year>1999, cluster(id) robust;

foreach var of varlist lwh_n  lnmarketh_w  lratio_wage ltotexprcut child06 child718 nomale nofem nold
  ownhouse age age2 had_prob age_p age_p2 had_prob_p lwhn_p lnmarkethw_p {;
egen m`var'=mean(`var') if e(sample);
};

gen one=1;
gen zer=0;

gen xb_common=_b[satlif0:child06]*zer+_b[satlif0:child718]*zer+
_b[satlif0:nomale]*zer+_b[satlif0:nofem]*zer+_b[satlif0:nold]*zer+_b[satlif0:ownhouse]*one
+_b[satlif0:_Igeo_2]*zer+_b[satlif0:_Igeo_3]*zer+_b[satlif0:_Igeo_4]*zer+_b[satlif0:_Igeo_5]*zer
+_b[satlif0:_Igeo_6]*zer+_b[satlif0:_Igeo_7]*zer
+_b[satlif0:_Igeo_8]*zer +_b[satlif0:_Iyear_2001]*zer+_b[satlif0:_Iyear_2002]*zer+_b[satlif0:_Iyear_2003]*zer
+_b[satlif0:_Iyear_2004]*one;

gen xbf = _b[satlif0:lwh_n]*mlwh_n+_b[satlif0:lnmarketh_w]*lnmarketh_w+_b[satlif0:lratio_wage]*mlratio_wage
+_b[satlif0:ltotexprcut]*mltotexprcut+_b[satlif0:age]*mage+_b[satlif0:age2]*mage2
+_b[satlif0:had_prob]*0+xb_common;

gen xbm = _b[satlif0_p:lwhn_p]*mlwhn_p+_b[satlif0_p:lnmarkethw_p]*mlnmarkethw_p+
_b[satlif0_p:lratio_wage]*mlratio_wage+_b[satlif0_p:ltotexprcut]*mltotexprcut+_b[satlif0_p:age_p]*mage_p
+_b[satlif0_p:age_p2]*mage_p2+_b[satlif0_p:had_prob_p]*mhad_prob_p +xb_common;

gen p44_lwhn=binormal(_b[cut13:_cons]-xbf, _b[cut23:_cons]-xbm, _b[athrho:_cons])
- binormal(_b[cut13:_cons]-xbf, _b[cut22:_cons]-xbm, _b[athrho:_cons])
- binormal(_b[cut12:_cons]-xbf,_b[cut23:_cons]-xbm,_b[athrho:_cons])
+ binormal(_b[cut12:_cons]-xbf,_b[cut22:_cons]-xbm,_b[athrho:_cons]);

scatter p44_lwhn lwhn;

predict p44, outcome(4,4);

scatter p44 lwhn;





  

-- 
Best regards,
 Ekaterina                          mailto:eka.selez@gmail.com

*
*   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   |   What's new   |   Site index