Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: dtobit error with some datasets but not others


From   "Joana Quina" <[email protected]>
To   [email protected]
Subject   Re: st: RE: dtobit error with some datasets but not others
Date   Wed, 12 Apr 2006 10:19:51 +0100

Maarten,

Following your suggestion, I undid the correction in the dtobit ado
file and typed -version 8.2- before the -tobit- command. It worked. 
Thank you very much.

Thanks and regards
Joana

On 12/04/06, Maarten Buis <[email protected]> wrote:
> Joana:
> You can either undo the correction you made in the ado file, and type -version 8.2- before typing the -tobit- command, or hunt the dtobit ado file for every occurrence of _b[_se] and replace that _b[/sigma], or use -mfx- instead of -dtobit- to get the marginal effects.
> HTH,
> Maarten
>
> -----------------------------------------
> Maarten L. Buis
> Department of Social Research Methodology
> Vrije Universiteit Amsterdam
> Boelelaan 1081
> 1081 HV Amsterdam
> The Netherlands
>
> visiting adress:
> Buitenveldertselaan 3 (Metropolitan), room Z214
>
> +31 20 5986715
>
> http://home.fsw.vu.nl/m.buis/
> -----------------------------------------
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]On Behalf Of Joana Quina
> Sent: woensdag 12 april 2006 11:02
> To: [email protected]
> Subject: st: dtobit error with some datasets but not others
>
> I am having trouble using -dtobit- for some datasets but not others. I
> have already corrected the dtobit ado file as suggested in the posting
> http://www.stata.com/statalist/archive/2005-06/msg00294.html.
>
> "change line 40 of -dtobit- from:
>
> *scalar `sigma' = _b[_se]
> to
> scalar `sigma' = _b[/sigma]"
>
> -dtobit- seems to be working fine when I try an example from
> Wooldridge (2002), as described in
> http://www.ats.ucla.edu/stat/stata/examples/eacspd/chapter16.htm.
> However, when I try it with one of my datasets I get the error [_se]
> not found. However, it works fine as dtobit, brief censor.
> When I try another of my datasets I have no problem.
>
> I have included my output below.
>
> Any help would be much appreciated.
>
> Thanks and regards,
> Joana
>
> . tobit basic_edu_prop lpop lgdp_pc_ppp sw_open polity_n pts_s_n
> corrupt milm_j us
> > _un_friend japan_un_friend uk_un_friend france_un_friend y_colony, ll(0)
>
> Tobit regression                                  Number of obs   =         27
>                                                  LR chi2(12)     =      21.87
>                                                  Prob > chi2     =     0.0391
> Log likelihood =  -54.81487                       Pseudo R2       =     0.1663
>
> ------------------------------------------------------------------------------
> basic_edu_~p |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
> -------------+----------------------------------------------------------------
>        lpop |   -.360373   1.218181    -0.30   0.771    -2.956864    2.236118
> lgdp_pc_ppp |   1.397576   1.563423     0.89   0.385    -1.934781    4.729933
>     sw_open |  -1.255893   2.129688    -0.59   0.564    -5.795216    3.283431
>    polity_n |  -.2126852   .2969647    -0.72   0.485    -.8456506    .4202801
>     pts_s_n |   2.498447   1.372578     1.82   0.089    -.4271344    5.424028
>     corrupt |  -2.417395   .9287006    -2.60   0.020    -4.396874   -.4379165
>      milm_j |   .4366181   1.095545     0.40   0.696    -1.898481    2.771717
> us_un_friend |  -.0043474   .2777796    -0.02   0.988    -.5964206    .5877259
> japan_un_f~d |  -3.184145   1.457518    -2.18   0.045    -6.290771   -.0775182
> uk_un_friend |  -1.286873   1.692384    -0.76   0.459    -4.894104    2.320358
> france_un_~d |   3.560504   1.825879     1.95   0.070    -.3312645    7.452272
>    y_colony |  -.1479806   .0835515    -1.77   0.097    -.3260663    .0301051
>       _cons |   110.4901   115.7913     0.95   0.355    -136.3133    357.2935
> -------------+----------------------------------------------------------------
>      /sigma |   3.501857   .5925446                      2.238878    4.764836
> ------------------------------------------------------------------------------
>  Obs. summary:          8  left-censored observations at basic_edu_prop<=0
>                        19     uncensored observations
>                         0 right-censored observations
>
> .
> .
> . dtobit, brief
> [_se] not found
> r(111);
>
>
>
> . dtobit, brief censor
>
> ------------------------------------------------------------------------------
>         | Marginal Effects at Observed Censoring Rate
>         |--------------------------------------------------------------------
>         |   Latent      Unconditional     Conditional on      Probability
>  Name   |  Variable     Expected Value    being Uncensored    Uncensored
> ---------+--------------------------------------------------------------------
>    lpop | -.36037296      -.25359579        -.17864984        -.03557883
> lgdp_pc_ppp | 1.3975759     .98347934         .69282865         .13797961
> sw_open*| -1.2558926      -.88377626        -.62259113        -.12399152
> polity_n | -.21268524      -.14966739        -.10543572        -.02099795
> pts_s_n |  2.4984468       1.7581663           1.23857         .24666618
> corrupt |  -2.417395      -1.7011298        -1.1983897        -.23866411
>  milm_j |  .43661806       .30724974         .21644728         .04310634
> us_un_friend |-.00434739   -.00305927        -.00215516        -.00042921
> japan_un_friend |-3.1841446-2.2406944         -1.578495        -.31436363
> uk_un_friend | -1.286873   -.90557727        -.63794922        -.12705015
> france_un_friend | 3.5605036 2.5055396        1.7650697         .35152072
> y_colony | -.14798061       -.1041345        -.07335931         -.0146098
>   _cons |   110.4901        77.75229         54.773915         10.908445
> ---------+--------------------------------------------------------------------
> (*) dF/dx is for discrete change of dummy variable from 0 to 1
>
>
>
>
>
>
> **Another dataset
>
>
> . tobit lc_dac_pc1 lpop lgdp_pc_ppp elrsacw polity_n pts_s_n corrupt
> milm_j us_un_
> > friend japan_un_friend uk_un_friend france_un_friend y_colony , ll(0)
>
> Tobit regression                                  Number of obs   =         99
>                                                  LR chi2(12)     =     135.99
>                                                  Prob > chi2     =     0.0000
> Log likelihood = -72.704573                       Pseudo R2       =     0.4833
>
> ------------------------------------------------------------------------------
>  lc_dac_pc1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
> -------------+----------------------------------------------------------------
>        lpop |  -.5650528    .059203    -9.54   0.000    -.6827252   -.4473805
> lgdp_pc_ppp |  -.0869744   .0847644    -1.03   0.308    -.2554528     .081504
>     elrsacw |  -.1654483   .1547859    -1.07   0.288    -.4731019    .1422054
>    polity_n |  -.0169189   .0210876    -0.80   0.425    -.0588327    .0249949
>     pts_s_n |   .0769045   .0710294     1.08   0.282    -.0642742    .2180833
>     corrupt |  -.0658932   .0306365    -2.15   0.034    -.1267866   -.0049999
>      milm_j |  -.0031017   .0018857    -1.64   0.104    -.0068498    .0006463
> us_un_friend |  -.0130154   .0190861    -0.68   0.497    -.0509511    .0249203
> japan_un_f~d |   .0600286   .0297403     2.02   0.047     .0009165    .1191406
> uk_un_friend |  -.0575564   .0387375    -1.49   0.141    -.1345514    .0194385
> france_un_~d |  -.0152241   .0311973    -0.49   0.627    -.0772321    .0467839
>    y_colony |    .006354   .0036644     1.73   0.086    -.0009293    .0136373
>       _cons |    5.62521   2.805552     2.01   0.048     .0488727    11.20155
> -------------+----------------------------------------------------------------
>      /sigma |    .501144   .0361867                       .429219     .573069
> ------------------------------------------------------------------------------
>  Obs. summary:          2  left-censored observations at lc_dac_pc1<=0
>                        97     uncensored observations
>                         0 right-censored observations
>
>
>
>
> . dtobit, brief
>
> ------------------------------------------------------------------------------
>         | Marginal Effects at Means
>         |--------------------------------------------------------------------
>         |   Latent      Unconditional     Conditional on      Probability
>  Name   |  Variable     Expected Value    being Uncensored    Uncensored
> ---------+--------------------------------------------------------------------
>    lpop | -.56505284      -.56505284        -.56505284        -3.342e-10
> lgdp_pc_ppp |-.08697438    -.08697438        -.08697438        -5.145e-11
> elrsacw | -.16544828      -.16544828        -.16544828        -9.787e-11
> polity_n | -.01691889      -.01691889        -.01691889        -1.001e-11
> pts_s_n |  .07690454       .07690454         .07690454         4.549e-11
> corrupt | -.06589323      -.06589323        -.06589323        -3.898e-11
>  milm_j | -.00310172      -.00310172        -.00310172        -1.835e-12
> us_un_friend |-.01301542   -.01301542        -.01301542        -7.699e-12
> japan_un_friend | .06002858 .06002858         .06002858         3.551e-11
> uk_un_friend |-.05755644   -.05755644        -.05755644        -3.405e-11
> france_un_friend |-.01522407-.01522407       -.01522407        -9.005e-12
> y_colony |  .00635396       .00635396         .00635396         3.759e-12
>   _cons |  5.6252101       5.6252101         5.6252101         3.327e-09
> ---------+--------------------------------------------------------------------
>
>
> . use http://www.stata.com/data/jwooldridge/eacsap/mroz
>
> . tobit hours nwifeinc educ exper expersq age kidslt6 kidsge6, ll(0)
>
> Tobit regression                                  Number of obs   =        753
>                                                  LR chi2(7)      =     271.59
>                                                  Prob > chi2     =     0.0000
> Log likelihood = -3819.0946                       Pseudo R2       =     0.0343
>
> ------------------------------------------------------------------------------
>       hours |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
> -------------+----------------------------------------------------------------
>    nwifeinc |  -8.814243   4.459096    -1.98   0.048    -17.56811   -.0603724
>        educ |   80.64561   21.58322     3.74   0.000     38.27453    123.0167
>       exper |   131.5643   17.27938     7.61   0.000     97.64231    165.4863
>     expersq |  -1.864158   .5376615    -3.47   0.001    -2.919667   -.8086479
>         age |  -54.40501   7.418496    -7.33   0.000    -68.96862    -39.8414
>     kidslt6 |  -894.0217   111.8779    -7.99   0.000    -1113.655   -674.3887
>     kidsge6 |    -16.218   38.64136    -0.42   0.675    -92.07675    59.64075
>       _cons |   965.3053   446.4358     2.16   0.031     88.88528    1841.725
> -------------+----------------------------------------------------------------
>      /sigma |   1122.022   41.57903                      1040.396    1203.647
> ------------------------------------------------------------------------------
>  Obs. summary:        325  left-censored observations at hours<=0
>                       428     uncensored observations
>                         0 right-censored observations
>
>
> . dtobit, brief
>
> ------------------------------------------------------------------------------
>         | Marginal Effects at Means
>         |--------------------------------------------------------------------
>         |   Latent      Unconditional     Conditional on      Probability
>  Name   |  Variable     Expected Value    being Uncensored    Uncensored
> ---------+--------------------------------------------------------------------
> nwifeinc | -8.8142429       -5.326442        -3.7461394        -.00302624
>    educ |  80.645606       48.734094         34.275171         .02768846
>   exper |   131.5643       79.504232         55.916113         .04517063
> expersq | -1.8641576      -1.1265094        -.79228521        -.00064003
>     age | -54.405011      -32.876918        -23.122662        -.01867915
> kidslt6 | -894.02174      -540.25683        -379.96798        -.30694898
> kidsge6 | -16.217996      -9.8005258        -6.8928069        -.00556821
>   _cons |  965.30528       583.33344         410.26418         .33142311
> ---------+--------------------------------------------------------------------
>
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index