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

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

From   Ekaterina Selezneva <>
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.


I would appreciate any hint.


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:_Igeo_8]*zer +_b[satlif0:_Iyear_2001]*zer+_b[satlif0:_Iyear_2002]*zer+_b[satlif0:_Iyear_2003]*zer

gen xbf = _b[satlif0:lwh_n]*mlwh_n+_b[satlif0:lnmarketh_w]*lnmarketh_w+_b[satlif0:lratio_wage]*mlratio_wage

gen xbm = _b[satlif0_p:lwhn_p]*mlwhn_p+_b[satlif0_p:lnmarkethw_p]*mlnmarkethw_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,

*   For searches and help try:

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