Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Tobit with gllamm


From   Walter McManus <[email protected]>
To   <[email protected]>
Subject   st: Tobit with gllamm
Date   Thu, 5 Aug 2010 13:03:10 -0400

I am using gllamm to estimate a model with a censored dependent variable and two random effects: an intercept and a price-slope.
The data are from a survey of consumers about plug-in hybrid electric vehicles (PHEV), and the dependent variable is the stated probability of purchasing a PHEV in several price scenarios.

I read the suggestions in statalist:

> Re: st: xttobit
> From Sophia Rabe-Hesketh <[email protected]> To [email protected]
> Subject Re: st: xttobit Date Sun, 29 Feb 2004 21:26:24 -0800
> Matt,
> I suggest first running xttobit and using the estimates as starting values for gllamm. For the example command you gave in your email, the data manipulation and gllamm command would be:
> xttobit zteq `vars', ll(0) ul(100) i(sys_id)
> * create a new dependent variable equal to 1 if right-censored * and 0 if left-censored:
> gen y=cond(zteq>=100,1,cond(zteq<=0,0,zteq)) if zteq<.
> * create offset variable equal to -100 if right-censored at * 100, 0 otherwise:
> gen off = cond(zteq>=100,-100,0)
> * create var=2 for censored observations, 1 otherwise:
> gen var=cond(zteq>=100|zteq<=0,2,1)
> * get starting values from xttobit (last two elements, /sigma_u * and /sigma_e need to be switched and need logarithm of /sigma_e:
> matrix a=e(b) local n=colsof(a) matrix a[1,`n']=a[1,`n'-1] matrix a[1,`n'-1]=ln(a[1,`n'])
> gllamm y `vars', offset(off) i(sys_id) fam(gauss binom) link(ident sprobit) /* */ lv(var) fv(var) from(a) copy adapt
> The default number of quadrature points gllamm uses is 8 (which may be more accurate than 12 with ordinary quadrature). You may have to increase this using nip(20), etc. (perhaps do a kind of quadcheck manually).
> Please let me know if you have any problems.

My dependent variable was originally measured on a scale from 0 to 100, so I followed your suggestions with an offset of -100. However, some of the results were puzzling--the predicted mu values for the censored observations were between 0 and 1 and the mu values for the uncensored observations included values > 100 and < 0. Thinking that the offset might be the source of the puzzlement, I rescaled the dependent variable to be on a 0 to 1 scale. This model requires no offset. The puzzle remains--I still get values above 1 and below 0.



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index