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

Re: st: bivariate ordinal probit model


From   Joseph Coveney <jcoveney@bigplanet.com>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   Re: st: bivariate ordinal probit model
Date   Thu, 18 Mar 2004 12:13:58 +0900

I'm not sure that Stata has a bivariate ordinal probit model estimating 
routine, per se.  But, depending upon what you're looking for, either -suest- 
or -gllamm- might give you what you want.  I've tried below to illustrate some 
possibilities for their use with an artificial multivariate ordinal probit 
dataset with two predictors, one continuous and one categorical (factor).

Joseph Coveney


--------------------------------------------------------------------------------


Chiara Seghieri wrote:

>Hello,
>
>Can Stata estimate a bivariate ordinal probit model?
>
>Thanks,
>
>Chiara

--------------------------------------------------------------------------------


set more off
drawnorm res2 res3, ///
  corr(1 0.7 \ 0.7 1) ///
  n(250) seed(20040318) clear
generate float x1 = invnorm(uniform())
forvalues dep = 2/3 {
    generate float y`dep' = 0.7 * x1 + ///
      sqrt(1 - 0.7^2) * res`dep'
}
generate byte y0 = 0
forvalues cut = 0.2(0.2)0.8 {
    replace y0 = y0 + (norm(y2) > `cut')
}
generate byte y1 = 0
forvalues cut = 0.1(0.25)0.85 {
    replace y1 = y1 + (norm(y3) > `cut')
}
drop y2 y3 res*
generate int pid = _n
oprobit y0 x1, score(sco0*)
estimates store A
oprobit y1 x1, score(sco1*)
estimates store B
suest A B
*
keep x1 y* pid
reshape long y, i(pid) j(x2)
generate float iac = x1 * x2
gllamm y x1 x2 iac, i(pid) family(binomial) ///
  link(oprobit) ip(g) nip(30) adapt trace allc
exit


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