Dear Statalist
I have gone through Tobit model in very a detailed way but reached a dead-end in trying to calculate the marginal effect for an IV Tobit model manually (NOT margins command) and I need your kind assistance please. As far as I know, if I want to calculate marginal effect manually (whether using nlcom or predictnl or whatsoever) for a tobit model with no endogenous variable I could simply do the following:
tobit Y X1 X2
predict xbeta, xb
egen avxbeta=mean(xbeta)
gen avxbsig=avxbeta/_b[/sigma]
gen lambda=normalden(avxbsig)/normal(avxbsig)
gen partial=_b[X1]*(1-lambda*(avxbsig+lambda))
sum partial
which satisfies:
margins, dydx(X1) predict(e(0,.)) atmeans
My question is: how can I do it if X1 is endogenous instrumented by Z1 as follows.
reg X1 Z1 X2
predict res, residual
tobit Y X1 X2 res
OR Simply put, for the code:
ivtobit Y (X1 = Z1) X2
how can I obtain [margins, dydx(X1) predict(e(0,.)) atmeans] mannually using nlcom or predictnl or any other way.
I know the ME calculation codes I posted above are not using nlcom or predictnl, but again please feel to provide codes using them.
Thanks in advance
Kind Regards
Thaer
Related Posts with Marginal effect manually for IV-Tobit
st_store() and stata() when using moptimize(): IV qregHi, I have a Mata function that creates a column vector (called yd below), passes it to Stata as a t…
random intercept random slope in multilevel GSEMHi, i would like to ask about adding random slope into the mediation model using GSEM. My model look…
🐍 Python: write to text fileDear All, below is a Stata-Python interface question. I need to write to a file opened in Stata fr…
Marginal effect in an Ordered probit model with discrete variablesDear Statalist Team, I have an ordered probit regression, where the outcome variable contains 4 pos…
_= invalid name r(198)Hi, I'm just getting back into Stata after a long illness, so I could use some help. I'm trying to r…
Subscribe to:
Post Comments (Atom)
0 Response to Marginal effect manually for IV-Tobit
Post a Comment