Statalist


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

st: dtobit - matrix has missing values


From   Johannes Geyer <JGeyer@diw.de>
To   statalist@hsphsun2.harvard.edu
Subject   st: dtobit - matrix has missing values
Date   Thu, 6 Mar 2008 18:21:34 +0100

Dear Statalist,

I used dtobit  (*! version 1.0.2  03aug2004) and dtobit2 to compute 
marginal effects after tobit and encountered a bug in this version of 
dtobit when using the option -censor-. When I set trace on, I get the 
follwing error:
 
----------------------------------------------------------------------------- 
begin dtobit.Display1 ---
    - args bm vm title level censor discret
    - local c colsof(`bm')
    = local c colsof(__00000L)
    - if `level'<10 | `level'>99 {
    = if 95<10 | 95>99 {
      local level 95
      }
    - tempname Z xmat rate
    - if "`censor'" == "" {
    = if "" == "" {
    - mat `xmat' = e(at)
    = mat __00000O = e(at)
matrix has missing values
      }
 
------------------------------------------------------------------------------- 
end dtobit.Display1 ---

after running (note that I changed all lines in dtobit.ado and dtobit2.ado 
with _b[_se]  to _b[/sigma] to have it run in version 9.2):

*
sysuse auto, clear
replace mpg = 20 if mpg <= 20
tobit mpg length weight, ll
dtobit, censor 
dtobit2 mpg length weight, ll(20)
*

it stops with dtobit. But when I add the option -brief- everything works:

*
sysuse auto, clear
replace mpg = 20 if mpg <= 20
tobit mpg length weight, ll
dtobit, brief censor 
dtobit2 mpg length weight, ll(20)
*

It happens when the program -display1- is called. In the presumably wrong 
version there was:

177             Display1  `B' `V' "`title'" "`level'" 
178             local title "Unconditional Expected Value"
                Display1 `dfdx_u' `V_u'  "`title'" "`level'" "`censor'" /*
                        */ "`discret'" 


I changed that and inserted "`censor'" and "`discret'" in line 177/178:

177             Display1  `B' `V' "`title'" "`level'"   "`censor'" /*
178                     */ "`discret'"
179             local title "Unconditional Expected Value"
                Display1 `dfdx_u' `V_u'  "`title'" "`level'" "`censor'" /*
                        */ "`discret'" 

That seems to fix it - do you agree or did I miss something? In any case I 
have not fully understand why this error occurs. Any idea?


Johannes




*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index