没有做过
你可以下载cmp命令
看到其中的例子有,这需要你自己看命令和帮助了
These examples go beyond standard commands in Stata 12:
. webuse laborsup
* Regress an unbounded, continuous variable on an instrumented, binary one. 2SLS is consistent but less efficient.
. cmp (other_inc = fem_work) (fem_work = kids), ind($cmp_cont $cmp_probit) qui robust
. ivreg other_inc (fem_work = kids), robust
* Now regress it on a left-censored one, female income, which is only modeled for observations in which the woman works.
. gen byte ind2 = cond(fem_work, cond(fem_inc, $cmp_cont, $cmp_left), $cmp_out)
. cmp (other_inc=fem_inc kids) (fem_inc=fem_edu), ind($cmp_cont ind2)
* "IV-oprobit"
. cmp (kids = fem_educ) (fem_educ = fem_work), ind($cmp_oprobit $cmp_cont) tech(dfp) nolr
. margins, dydx(*) predict(eq(#1) pr outcome(#2)) force
* Ordered probit with Heckman selection modeling
. preserve
. webuse womenwk, clear
. gen selectvar = wage<.
. gen wage3 = (wage > 10)+(wage > 30) if wage < .
. cmp (wage3 = education age) (selectvar = married children education age), ind(selectvar*$cmp_oprobit $cmp_probit) qui
. restore
|