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

Re: st: gllamm question - estimating 4 random effects


From   Michael Ingre <[email protected]>
To   [email protected]
Subject   Re: st: gllamm question - estimating 4 random effects
Date   Tue, 13 Jul 2004 12:42:12 +0200

Hi Amy

I Think the following soloution will give you what you want. The emans and standrad deviations of the random effects will be stored in um1-um4 and us1-us4. 

. gen R_DR   = R*DR  

. eq int   : const
. eq R     : R
. eq DR    : DR
. eq R_DR  : R_DR

. gllamm y R DR R_DR , i(gvkey) nrf(4)eqs(int R DR R_DR) adapt
. gllapred u , u


I bit of caution though, 4 random effects is quite a lot for gllamm , especially with a continous outcome. You are likely to end up with a model that take hours (or even days) to converge. You might want to try with fewer integration points first and then increase them to get to the final solution:

. gllamm y R DR R_DR , i(gvkey) nrf(4)eqs(int R DR R_DR) adapt nip(3)
. matrix b = e(b)
. gllamm y R DR R_DR , i(gvkey) nrf(4)eqs(int R DR R_DR) adapt nip(8) from(b)

and the test if it was enough integration points with a final model:

. matrix b = e(b)
. gllamm y R DR R_DR , i(gvkey) nrf(4)eqs(int R DR R_DR) adapt nip(16) from(b)

Michael




----- Original Message -----
From: Amy Dunbar <[email protected]>
Date: Tuesday, July 13, 2004 4:05 am
Subject: st: gllamm question - estimating 4 random effects

> I have a PhD student who estimated the following equation using 
> SAS proc
> mixed to generate variable firm- and time-specific coefficients.
> 
> y = a0 + a1DR + (B0 +B0i + B0t)R + (B1 + B1i +B1t)R*DR
> 
> where y is a firm-specific variable (earnings per share/price)
> DR  = 1 if the return is negative (firms losing in the market)
> R = firm return
> i = 791 firms where the variable gvkey is unique for each firm
> t = 13 years
> 
> I want to replicate her results using stata and I think I need to use
> gllaam.  We want to use the standardized random effects, B0i and 
> B1i, as
> variables in another model. I have Rabe-Sesketh & Everitt's 
> Handbook, which
> discusses gllaam with continuous data (post-natal depression 
> data), but
> where that model has a random intercept and one random slope, this 
> model has
> 4 random coefficients.
> 
> I know that I have to define the equations for the random effects, 
> but I am
> confused about the time coefficients.
> 
> gen R_DR = R*DR
> 
> eq coeffB0i: R
> eq coeffB0t: ?
> eq coeffB1i: R_DR
> eq coeffB1t: ?
> 
> gllamm y DR R R_DR, i(gvkey) nrf(4) eqs(coeffB0i coeffB0t coeffB1i 
> coeffB1t)adapt
> 
> Could someone help me learn how to estimate this model in Stata?  
> 
> Also, how do I get Stata to give me the individual coefficients by 
> firm?  Is
> there a command to standardize the coefficients?  
> It appears that I use gllapred, but I'm not sure. 
> 
> Thank you.
> 
> Amy Dunbar 
> Department of Accounting 
> School of Business 
> University of Connecticut 
> 2100 Hillside Road, Unit 1041 
> Storrs, CT 06269-1041 
> This email and any files transmitted with it are confidential and 
> intended solely for the use of the individual or entity to whom 
> they are addressed. If you have received this email in error 
> please notify the system manager. This message contains 
> confidential information and is intended only for the individual 
> named. If you are not the named addressee you should not 
> disseminate, distribute or copy this e-mail.
> 


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index