Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: xtmixed question: 4 level random effects nested and crossed factors)


From   "Sharif S. Aly" <[email protected]>
To   [email protected]
Subject   st: xtmixed question: 4 level random effects nested and crossed factors)
Date   Tue, 10 Apr 2007 03:47:01 -0700

Dear list,
I am trying to fit a 4 level random effects model to a continuous outcome to estimate the respective variance components of each level of the 4.
Level 4 is farm (two farms);
Level 3 is stall (12 in first farm & 8 in second farm);
Level 2 is testday (this is crossed and made up of 3 days. Example: day1 in any particular stall is the same as day 1 in another stall).
Level 1 is tester (this is crossed and made up of 2 testers. Example: tester 1 on any day in any stall is the same tester 1 in another day in another pen).

I am having trouble writing the command that would allow for levels 3 and 4 to be nested followed by the lower two levels to be crossed under level 3.

I tried:
Model 1:
xtmixed outcome || farm: || stall: R.testday || tester: , variance
This model converged the problem is that I dont get a variance estimate for stall, instead I get Stall (Testday) which is I am interpreting as a model for stall with a seperate random intercept for each testday.

Model 2: similar to above but switched tetsday and tester
xtmixed outcome || farm: || stall: R.tester || testday: , variance
Again converged but got variance estimate of Stall(tester) which I am again interpreting as a model for tester with seperate random intercept for each day.

(A side question is I still get a residual estimate, can it be interpret as the interaction of cross over random effects?)

Model 3:
I created a combined variable for tester and testday using:
egen comb = group(testday tester)
Then:
xtmixed outcome || farm: || stall: || _all: R.testday || comb: , variance
(did not converge)

Any suggestions will be very appreciated!
Sharif Aly

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