Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tobit regression with cmp - how to truncate from both sides?

    I have a system of equations that have all dependent variables censored at left (0) and right (1). I am trying get this work with cmp package and I am using Stata 14.2.

    I have tried my estimations like this:

    Code:
    cmp (eq1: y1 = x1 x2 x3, trunc(0 1)) (eq2: y2 = x1 x2 x3, trunc(0 1)),
    indicators($cmp_trunc, $cmp_trunc) constraints(1-3) vce(cluster clusterId)
    Unfortunately that ends up with an error message:
    Code:
       cmp_model::cmp_init():  3301  subscript invalid
                     <istmt>:     -  function returned error
    Mata run-time error
    r(3301);
    I am not sure whether the syntax is incorrect or whether there is some other reason for the error. I have run my model with left censoring only and that works:

    Code:
    cmp (eq1: y1 = x1 x2 x3) (eq2: y2 = x1 x2 x3),
    indicators("cond(y1>0, $cmp_trunc, $cmp_left)" "cond(y2>0, $cmp_trunc, $cmp_left)") constraints(1-3) vce(cluster clusterId)
    Is there any ideas how to proceed?

  • #2
    Truncation and censoring are not the same thing. Tobit censors. You might look at the early parts of my Stata Journal paper about cmp.

    There should be no comma in the indicators() option.

    That said, cmp should crash, as you show it to have done. So if you want to send me exact data and code, for the crash, I can figure out what happened there.

    The last example looks jumbled. Look at the tobit examples in the help file. None of them use "$cmp_trunc" but rather "$cmp_cont" where you have "$cmp_trunc". Work to understand these simpler examples before you take on more complicated ones. To left- and right-censor, you'll want something like "cond(y1>0, cond(y1<1, $cmp_cont, $cmp_right), $cmp_left)".

    Comment

    Working...
    X