. ssc install cmp
checking cmp consistency and verifying not already installed...
unexpected end of file
could not copy http://fmwww.bc.edu/repec/bocode/c/cmp.ado
(no action taken)
r(612);
我的理解是,ind()是指定函数形式,也就是指定(被解释变量1=.... )和(被解释变量2=... )的形式。
0 = observation is not in this equation's sample
1 = equation is "continuous" for this observation, i.e., has the OLS
likelihood or is an uncensored observation in a tobit equation
2 = observation is left-censored for this (tobit) equation at the
value stored in the dependent variable
3 = observation is right-censored at the value stored in the
dependent variable
4 = equation is probit for this observation
5 = equation is ordered probit for this observation
6 = equation is multinomial probit for this observation
7 = equation is interval-censored for this observation
8 = equation is truncated on the left and/or right (obsolete because
truncation is now a general modeling feature)
9 = equation is rank-ordered probit for this observation
比如1就是ols,5就是oprobit,对应到具体代码中,就是 $cmp_cont 和 $cmp_oprobit
$cmp_out = 0
$cmp_cont = 1
$cmp_left = 2
$cmp_right = 3
$cmp_probit = 4
$cmp_oprobit = 5
$cmp_mprobit = 6
$cmp_int = 7
$cmp_trunc = 8
$cmp_roprobit = 9
根据说明文档中的例子,如果进行2sls,原本的代码是ivreg y x1 (x2=z)
就相当于 cmp (y=x1 x2) (x2=x1 z), ind($cmp_cont $cmp_cont).
我觉得如果是一阶段ols,二阶段oprobit,那么代码是
cmp (y=x1 x2) (x2=x1 z), ind($cmp_oprobit $cmp_cont).