Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Nick Cox" <n.j.cox@durham.ac.uk> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | st: RE: Tobit with gllamm |
Date | Thu, 5 Aug 2010 18:16:01 +0100 |
This is in part not my usual territory, but it seems to me that you are conflating two quite distinct issues, censoring of responses and bounded responses. -tobit- is for censored responses and the essence of the problem is that at least some responses were, we believe, really greater and/or less than was recorded. Although you describe your variable as "censored", what is most obvious from your description is that it is a bounded variable, which in principle cannot be greater or less than the bounds specified. This is in a sense the opposite situation from censoring. As you say, you can rescale so that limits lie between 0 and 1, but the problem with -tobit- necessarily remains exactly the same. But rescaling to [0,1] does make other things easier. You might benefit from Kit Baum's mini-review SJ-8-2 st0147 . . . . . . . . . . . . . . Stata tip 63: Modeling proportions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C. F. Baum Q2/08 SJ 8(2):299--303 (no commands) tip on how to model a response variable that appears as a proportion or fraction I don't think the use of -gllamm- affects this central question. Nick n.j.cox@durham.ac.uk Walter McManus 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 <sophiarh@berkeley.edu> To statalist@hsphsun2.harvard.edu > 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/