groups in xtmixed

#1
Hi all

Having some issues with Stata when running xtmixed. The main issue being the number of groups (in initial Group Variable table) is not what I expect it to be.

This is a 3-level model. The first is hospital, the second is individuals. As in individuals is the higher level , as they can visit one or more hospitals. Then they provide a score of satisfaction for the hospital which is done at up to 4 different timepoints.

Individuals can visit up to 4 different hospitals and provide 4 different satisfaction scores, or they can give one hospital 4 separate satisfaction scores.

So the command for the null model reads something like xtmixed satisfaction || individualID: || hospital_code.

I have 800 individuals and 50 unique hospitals. However when I run the code the number of groups I get for individuals is around 600. (The number of hospitals is correct though).

I suspect it's because one individual can visit the same hospital up to 4 times and provide four scores that are the same? So it's almost collapsed down? Anyone know how to get Stata to recognise that these are separate observations even though the data is all the same?

Hoping someone can shed some light on this!

Cheers.