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]
Re: st: RE: Error message when using SSM (ordered probit with sample selection)
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: RE: Error message when using SSM (ordered probit with sample selection)
Date
Thu, 21 Jul 2011 09:22:14 -0500
I note that -select- does not vary within the dataset used by -ssm-
because -select- is 1 if and only if -ordvar- is non-missing. Is that
what you want? I don't use this stuff, but that may be what is wrong.
Nick
On Thu, Jul 21, 2011 at 7:08 AM, Katic, Pamela (IWMI-Ghana)
<[email protected]> wrote:
> I have reproduced the following example from Miranda and Rabe-Hesketh
> (2006) but I still get the error message r(2000), that is, no
> observations on which to run the model. So I suppose it is probably not
> a problem of my coding:
>
> set seed 12345678
> set obs 3500
> gen lambda = 0.4
> gen double ve = invnormal(uniform())
> gen double zeta = invnormal(uniform())
> gen double tau = invnormal(uniform())
> gen double x1=invnormal(uniform())
> gen double x2=invnormal(uniform())
> gen double x3=invnormal(uniform())
> gen double x4=invnormal(uniform())
> gen double selstar = 0.58 + 0.93*x1 + 0.45*x2 - 0.64*x3 + 0.6*x4 + ///
> (ve + zeta)/sqrt(2)
> gen sel = (selstar>0)
> gen double ystar = 0.30*x1 + 0.11*x2 + ///
> (lambda*ve + tau)/sqrt(1+lambda^2)
> gen ordvar = 0
> qui replace ordvar=1 if ystar>-0.40 & ystar<=0.17
> qui replace ordvar=2 if ystar>0.17 & ystar<=0.45
> qui replace ordvar=3 if ystar>0.45 & ystar<=0.80
> qui replace ordvar=4 if ystar>0.80 & ystar<=1.25
> qui replace ordvar=5 if ystar>1.25
> replace ordvar=. if sel==0
> ssm ordvar x1 x2, s(sel = x1 x2 x3 x4) q(16) adapt family(binom)
> link(oprobit)
>
> I am working with Stata 11.2. Does anyone know of an alternative command
> to calculate an ordered probit model with sample selection?
>
> Thanks!
>
> Pamela Katic
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Katic, Pamela
> (IWMI-Ghana)
> Sent: Tuesday, July 05, 2011 7:51 AM
> To: [email protected]
> Subject: st: Error message when using SSM (ordered probit with sample
> selection)
>
> I'm trying to estimate an ordered probit model with sample selection.
> I've only found one command in STATA that's able to do this: ssm. I
> tried using it but I keep getting the error message r(2000), that is, no
> observations on which to run the model. I checked the response variable
> and the selection variable as well, but cannot find any mistakes. I ran
> the ordered probit with no sample selection and it works fine, and so
> does the probit selection model separately. Any guidance on this matter
> will be greatly appreciated. Many thanks.
>
*
* 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/