Announcement

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

  • Tobcm Error

    Below I ran the code and got the error message "type mismatch ". What is causing this error message and how can I resolve it. Unfortunately I'm not permitted to upload my data.



    . global xlist income2 income3 num_child1 num_child3 age_y35 age_y68 age_y911 age_y1214 age_y1517

    .
    . tobit yc_clothing_new $xlist [aweight = finlwt21] if hw_kids & age_young_member < 16, ll coefl

    Refining starting values:

    Grid node 0: log likelihood = -134363.44

    Fitting full model:

    Iteration 0: log likelihood = -134363.44
    Iteration 1: log likelihood = -133266.12
    Iteration 2: log likelihood = -133211.49
    Iteration 3: log likelihood = -133211.21
    Iteration 4: log likelihood = -133211.21

    Tobit regression Number of obs = 20,588
    Uncensored = 15,054
    Limits: lower = 0 Left-censored = 5,534
    upper = +inf Right-censored = 0

    LR chi2(9) = 1376.86
    Prob > chi2 = 0.0000
    Log likelihood = -133211.21 Pseudo R2 = 0.0051

    ----------------------------------------------------------------------------------------
    yc_clothing_new | Coef. Legend
    -----------------------+----------------------------------------------------------------
    income2 | 207.5969 _b[income2]
    income3 | 542.2358 _b[income3]
    num_child1 | -297.51 _b[num_child1]
    num_child3 | 135.2216 _b[num_child3]
    age_y35 | -395.4306 _b[age_y35]
    age_y68 | -415.3662 _b[age_y68]
    age_y911 | -389.5229 _b[age_y911]
    age_y1214 | -587.762 _b[age_y1214]
    age_y1517 | -636.838 _b[age_y1517]
    _cons | 607.0668 _b[_cons]
    -----------------------+----------------------------------------------------------------
    var(e.yc_clothing_new)| 1442668 _b[/var(e.yc_clothing_new)]
    ----------------------------------------------------------------------------------------

    .
    . tobcm
    type mismatch
    r(109);

    .

  • #2
    Your problem about confidential data is already addressed in the FAQ Advice.

    If your dataset is confidential, then provide a fake example instead.
    Same section (#12) explains that you should explain where community-contributed programs you refer to come from, in this case tobcm.

    Further,

    Code:
    set trace on 
    would allow identification of which line within tobcm produces the error.

    Comment


    • #3
      Hi Nick,

      To address the second question, the Tobcm command was a program designed by David Drukker below. This is the installation message for the command below within STATA.

      TITLE
      tobcm. Testing for normality after tobit estimation.

      DESCRIPTION/AUTHOR(S)
      Program by David Drukker, StataCorp <[email protected]>.
      Updated statalist distribution, 05 November 2002.

      tobcm implements a conditional moment test for testing the
      null hypothesis that the disturbances in a tobit model have
      a normal distribution. This test was derived by Pagan and
      Vella (1989), who built on work by Newey (1985) and Tauchen (1985).
      tobcm also implements the bootstrap method described by Drukker (2002).

      INSTALLATION FILES (click here to install)
      tobcm/tobcm.ado
      tobcm/tobcm.hlp
      tobcm/_tobsimdta.ado

      Comment


      • #4
        tobit has been rewritten in Stata 15. tobcm expects the old version of tobit, thus Alexis should run tobit under version control:

        Code:
        version 14: tobit ...
        tobcm

        Comment


        • #5
          Thank you Rafal. This addressed my issue by using STATA version 14.

          Comment


          • #6
            What do the TOBCM results mean when running the model below? Does this mean that the data has normality?

            . tobit yc_clothing_new $xlist if hw_kids & age_young_member < 16 [aweight = finlwt21], ll(0)
            (sum of wgt is 3.9590e+08)

            Tobit regression Number of obs = 20,588
            LR chi2(9) = 1376.86
            Prob > chi2 = 0.0000
            Log likelihood = -133211.21 Pseudo R2 = 0.0051

            ------------------------------------------------------------------------------
            yc_clothin~w | Coef. Std. Err. t P>|t| [95% Conf. Interval]
            -------------+----------------------------------------------------------------
            income2 | 207.5969 21.45782 9.67 0.000 165.5379 249.6559
            income3 | 542.2358 21.73029 24.95 0.000 499.6427 584.8289
            num_child1 | -297.51 21.51124 -13.83 0.000 -339.6737 -255.3463
            num_child3 | 135.2216 21.05049 6.42 0.000 93.96093 176.4822
            age_y35 | -395.4306 25.11077 -15.75 0.000 -444.6497 -346.2114
            age_y68 | -415.3662 26.69239 -15.56 0.000 -467.6854 -363.047
            age_y911 | -389.5229 27.71838 -14.05 0.000 -443.8531 -335.1926
            age_y1214 | -587.762 28.62532 -20.53 0.000 -643.8699 -531.6541
            age_y1517 | -636.838 50.72145 -12.56 0.000 -736.2561 -537.4199
            _cons | 607.0668 22.27782 27.25 0.000 563.4005 650.7331
            -------------+----------------------------------------------------------------
            /sigma | 1201.111 7.229949 1186.94 1215.282
            ------------------------------------------------------------------------------
            5,534 left-censored observations at yc_clothin~w <= 0
            15,054 uncensored observations
            0 right-censored observations

            . tobcm

            Conditional moment test against the null of normal errors

            CM Prob > chi2
            677.08 0.00000


            Last edited by Alexis Adams; 30 Nov 2017, 14:21.

            Comment

            Working...
            X