Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: reoprob and clustering


From   Joerg Luedicke <joerg.luedicke@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: reoprob and clustering
Date   Sun, 3 Jul 2011 09:43:18 -0400

You should have said in your post where -reoprob- is from. Anyway,to
me it seems that -gllamm- is much faster than -reoprob-, which seems
to be really slow. Consider the following fake data with 5000
observations from 1000 subjects. Whereas -reoprob- takes around 110
seconds, -gllamm- needs around 25 seconds for a model with one
covariate on my machine.

/*********************/
*creating some fake data

clear all
set obs 1000
matrix m1=(10, 0)
matrix sd1=(1, 1)
matrix C1 = (1.0000, 0.5, 1.0000)
drawnorm y1 x1 , n(1000) means(m1) sds(sd1) corr(C1) cstorage(upper) forcepsd
gen id=_n
expand 5
bys id: gen time=_n
sort id time
bys id: replace y1=y1[_n-1]+(1+rnormal()) if _n>1
bys id: replace x1=x1[_n-1]+(0.2+rnormal()) if _n>1
gen dv=.
forval i=1/5{
	qui sum y1 if time==`i', d
	replace dv=cond(y1<r(p25), 1, cond(y1<r(p75),2,3)) if time==`i'
	}

/*********************/
*comparing models
	
timer on 1
reoprob dv x1, i(id)
timer off 1

timer on 2
gllamm dv x1 , i(id) link(oprobit) nip(12)
timer off 2

qui timer list 1
di as txt "time elapsed reoprob (seconds): " as res r(t1)
qui timer list 2
di as txt "time elapsed gllamm (seconds): " as res r(t2)

/*********************/

Joerg


On Sun, Jul 3, 2011 at 7:33 AM, Dimitrije Tišma
<dimitrijetisma@gmail.com> wrote:
> Dear all,
>
> I am trying to do some random ordinal probit estimations and am
> possibly facing a tough trade-off. Gllamm has a built-in option for
> clustering when working with random ordinal probit, while -reoprob-
> does not. On the other hand, the latter is around three times faster
> than gllamm, at least on my computer. I want to do around 60
> regressions in total and this time cost is substantial. So, I was
> wondering if anyone knows of some way to adjust for standard errors
> when working with reoprob? And if yes, how can it be done? Thanks a
> lot!
>
> Dimitrije
> *
> *   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/
>

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index