| |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Delta method for std. Errors of partial effects
Dear all,
I am trying to apply the delta method to compute the standard errors of
average partial effects (APEs) after -gologit2- (I know I could use
-margeff-, but I need to do it manually so I can apply it to models not
supported by -margeff-)
For this calculation of the std errors I am following, equation 21 in
Bartus (2005).
While the coefficients for the APEs are identical, the results for std
errors do not match with the -margeff- command.
Below there is an example for APEs of a dummy variable in the first
equation of the -gologit2- command.
I would be grateful if somebody could give me advice on how to apply the
Delta method.
Thank you in advance
Regards
Manos
Bartus (2005), Estimation of marginal effects using margeff, Stata
Journal, 5, 3, p.309-329.
*##################### Begin example #######################
clear
use "http://www.indiana.edu/~jslsoc/stata/spex_data/ordwarm2.dta", clear
rename male x1
gen y= warm
replace y=1 if y==1|y==2
replace y=2 if y==3
replace y=3 if y==4
gologit2 y x1, link(probit)
scalar n=e(N)
capture drop xb1 - b3
predict xb1,xb outcome(1)
gen b1= _b[1:x1]
* Here I compute manually the coefficient for APEs for the first
equation *
capture drop ape1
gen ape = normprob(- xb1 - b1*1 + b1*x1) - normprob(-xb1 +b1*x1)
sum ape
* using -margeff- to verify the estimate of the coefficient
margeff
* Here I am trying to apply the delta method as in Bartus (2005)
capture drop g1 - c2
gen double g1 =x1*normd(- xb1 - b1*1 + b1*x1)
egen double c1=total(g1)
scalar s1=c1/n
gen double g2 =x1*(normd(- xb1 - b1*1 + b1*x1) - normd(-xb1 +b1*x1))
egen double c2=total(g2)
scalar s2=c2/n
mat G=( s1 \ 0 \ s2 \ 0 )
matrix list G
matrix V=get(VCE)
matrix list V
matrix GVG=G'*V*G
matrix list GVG
scalar stderr=sqrt(el(GVG,1,1))
scalar list stderr
* Using margeff to verify the std errors result, but the two estimates
are very different
margeff
*##################### End example #######################
*
* 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/