Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: IVTOBIT, missing values, panel


From   "joe jacob" <[email protected]>
To   [email protected]
Subject   st: IVTOBIT, missing values, panel
Date   Sun, 14 Sep 2003 17:03:15 +0000

Dear listers,

I have three questions. First is a follow up to a question that was posted last year (31 Jul 2002, to be precise) by Kee-Lee Lee. The problem is one of getting the error message ---matrix has missing values--while running IVTOBIT. There is no missing value in the variables used, though.

I followed the suggestion of Nick Cox to --set trace on--. I attach the stata output below. Could anyone figure out the reason?

My second question is, is anyone aware of any stata module that extends ivtobit to a panel setting?

Finally, I would like to know if it is possible to estimate the Log Likelihood after estimating ivtobit.

Many thanks in advance,


Joe Jacob

****Stata Output******

ivtobit ird, endog(expsal) iv(wager ltlnou size2) exog(outs forg

 y90 y91 y92 y93 y94 y95 y96 y97) ll(0) ul(1900000000)
- version 6.0
- syntax varlist [if] [in], ENDOG(varlist) IV(varlist) EXOG(varlist) [LL(real 0

) UL(real 9999999)]
- local depvar "`varlist'"
- tempvar tmpy touse
- marksample touse
- local niv : word count `iv'
- local nendog : word count `endog'
- local nexog : word count `exog'
- local K=`nexog'+`niv'
- matrix Dhat=J(`K'+1,`nendog'+`nexog'+1,0)
- matrix Dhat[`niv'+1,`nendog'+1]=I(`nexog'+1)
- parse "`endog'", parse(" ")
- local e = 1
- while `e'<=`nendog' {
- qui regress `1' `iv' `exog' if `touse'
- matrix tmp=get(_b)
- matrix Dhat[1,`e']=tmp'
- tempvar fitted`e' resid`e'
- qui predict `fitted`e'' `if'
- version 7.0
- if _caller()<=5 | "`e(predict)'"=="" {
_predict `0'
}
- else {
- local v=_caller()
- version `v'
- `e(predict)' `0'
- version 6
- local myopts "COVratio DFBeta(varname) DFIts E(string) Hat Leverage Pr(string

) Welsch YStar(string)"
- _pred_se "`myopts'" `0'
- version 6.0
- sret clear
- gettoken ouser 0 : 0
- local orig `"`0'"'
- gettoken varn 0 : 0, parse(" ,[")
- gettoken nxt : 0, parse(" ,[(")
- if !(`"`nxt'"'=="" | `"`nxt'"'=="if" | `"`nxt'"'=="in" | `"`nxt'"'==",") {
local typ `varn'
gettoken varn 0 : 0, parse(" ,[")
}
- syntax [if] [in] [, `ouser' CONStant(varname numeric) noOFFset *]
- if `"`options'"' != "" {
_predict `orig'
sret local done 1
exit
}
- confirm new var `varn'
- sret local done 0
- sret local typ `"`typ'"'
- sret local varn `"`varn'"'
- sret local rest `"`0'"'
- if `s(done)' { exit }
- local vtyp `s(typ)'
- local varn `s(varn)'
- local 0 `"`s(rest)'"'
- syntax [if] [in] [, `myopts' noOFFset]
- local type "`covrati'`dfits'`leverag'`welsch'`hat'"
- local args `"`dfbeta'`pr'`e'`ystar'"'
- if "`type'"=="" & `"`args'"'=="" {
- di in gr "(option xb assumed; fitted values)"
- _predict `vtyp' `varn' `if' `in', `offset'
- label var `varn' "Fitted values"
- exit
- }
- qui replace `fitted`e'' =. if `1' ==.
- qui predict `resid`e'' `if', residuals
- version 7.0
- if _caller()<=5 | "`e(predict)'"=="" {
_predict `0'
}
- else {
- local v=_caller()
- version `v'
- `e(predict)' `0'
- version 6
- local myopts "COVratio DFBeta(varname) DFIts E(string) Hat Leverage Pr(string

) Welsch YStar(string)"
- _pred_se "`myopts'" `0'
- version 6.0
- sret clear
- gettoken ouser 0 : 0
- local orig `"`0'"'
- gettoken varn 0 : 0, parse(" ,[")
- gettoken nxt : 0, parse(" ,[(")
- if !(`"`nxt'"'=="" | `"`nxt'"'=="if" | `"`nxt'"'=="in" | `"`nxt'"'==",") {
local typ `varn'
gettoken varn 0 : 0, parse(" ,[")
}
- syntax [if] [in] [, `ouser' CONStant(varname numeric) noOFFset *]
- if `"`options'"' != "" {
- _predict `orig'
- sret local done 1
- exit
- if `s(done)' { exit }
- }
- qui replace `resid`e'' =. if `1' ==.
- local fitted "`fitted' `fitted`e''"
- local resid "`resid' `resid`e''"
- mac shift
- local e = 1 + `e'
- }
- while `e'<=`nendog' {
qui regress `1' `iv' `exog' if `touse'
matrix tmp=get(_b)
matrix Dhat[1,`e']=tmp'
tempvar fitted`e' resid`e'
qui predict `fitted`e'' `if'
qui replace `fitted`e'' =. if `1' ==.
qui predict `resid`e'' `if', residuals
qui replace `resid`e'' =. if `1' ==.
local fitted "`fitted' `fitted`e''"
local resid "`resid' `resid`e''"
mac shift
local e = 1 + `e'
}
- qui tobit `depvar' `fitted' `exog' if `touse',ll(`ll') ul(`ul')
- matrix tmp = get(_b)
- matrix beta=tmp[1,1..`nendog']
- local nobs=e(N)
- qui tobit `depvar' `iv' `exog' `resid' if `touse',ll(`ll') ul(`ul')
- local obs = e(N)
- local df = e(df_m)
- matrix tmp = get(_b)
- matrix alpha=J(1,`K'+1,0)
- matrix alpha[1,1]=tmp[1,1..`K']
- matrix alpha[1,`K'+1]=tmp[1,`K'+`nendog'+1]
matrix has missing values
r(504);

end of do-file
r(504);

.

_________________________________________________________________
Access Hotmail from your mobile now. http://server1.msn.co.in/sp03/mobilesms/ Click here.

*
* 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