Dear Statalist users,
I am estimating a multilevel model with three levels using the mixed command in Stata. Level 3 is the team (TeamID), level 2 is the individual (ID), and level 1 is the observation. In total, I have 187 observations.
I checked how many teams and individuals are in my sample, using the following code:
From the output (below), I conclude that I have 57 teams and 114 individuals in my sample. 
In the next step, I used the mixed command to estimate my model.
BUT the group size for the ID variable indicated in the output is not consistent with number of IDs in my sample. 
Can anyone help me spot the mistake? I am very certain that I do not have more than 114 different IDs in my sample (I also counted them manually).
I appreciate any advice! Thank you.
I am estimating a multilevel model with three levels using the mixed command in Stata. Level 3 is the team (TeamID), level 2 is the individual (ID), and level 1 is the observation. In total, I have 187 observations.
I checked how many teams and individuals are in my sample, using the following code:
Code:
by TeamID, sort: gen nvals = _n == 1 count if nvals drop nvals by ID, sort: gen nvals = _n == 1 count if nvals drop nvals
In the next step, I used the mixed command to estimate my model.
Code:
xtmixed leadTSat gcTSat Maj_owner Gender cEntExp cAgeDis cTAge2 TeamSize Sales_yes || TeamID: || ID: , mle cov(unstr) vsquish
Can anyone help me spot the mistake? I am very certain that I do not have more than 114 different IDs in my sample (I also counted them manually).
I appreciate any advice! Thank you.
Comment