# Three level mixed-effects (crossed and nested) model in stata

I am trying to fit a 3 level random and crossed effects model to a continuous outcome to estimate the respective variance components of each level of the 3 (for doctors)

• Level 3: Physicians ID
• Level 2: Patient's ID
• Level 1: stage ( 1 and 2)

For this study, each doctors have predicted the mortality rate for all the patients in two times. Thus clinician and patient is crossed effect and patient and stage is nested ( I think).

I presumed that Physicians id is crossed with patient and patient is nested with stage.

I tried the crossed random effects model for this data

Model1:

xtmixed  mortality_est || doctorsid:R. patient|| doctorsid:R.stage


Model2:

xtmixed  mortality_est || doctorsid:R. patient|| doctorsid:R. stage|| patient:

xtmixed  mortality_est ||stage:||doctorsid:R.patient||z:, variance


but did not converge

Any suggestion will be very appreciated.

-
What is the size and structure of your data? – Michael Chernick Sep 12 '12 at 10:56
There are nine doctors and 9 patients. Each doctor see each patient and predicted the mortality rate.This is repeated measures at 2 times (stage 1 and stage2). Thus crossed effect for doctors and patient and nested effect for patients and stage(not sure). Any advice would be much appreciated. – mohana Sep 13 '12 at 5:25

anova mortality_est doctorsid patient stage

If your ultimate goal is some sort of doctors' ICC or interrater agreement something, then I could see the point of the exercise, but again with just 9 observations, your variance component estimate will be woefully unstable, and effectively your CI for the ICC would look like (-0.1,0.8) or something like that. In the best case scenario of homoskedastic normal data, it is a (scaled) chi-square with 7 degrees of freedom (I think), so it has a mean of 7, a variance of 14, a standard deviation of 3.74, skewness of 1.07, and an excess kurtosis of 1.71; few statisticians would be happy to bet their publications on a $\chi^2_7$. In the worst case with doctor-patient interactions and heteroskedasticity, you may end up with something closer to chi-square with 1 or 2 d.f., and that isn't something you can really work with as a variance estimate.