Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: unique IDs in xtmixed
From
Teya Rutherford <[email protected]>
To
[email protected]
Subject
st: unique IDs in xtmixed
Date
Fri, 20 May 2011 10:39:35 -0700
Dear Stata experts.
I have encountered a strange thing in my analysis.
I am working with long data that has between one and three years of
information per student.
I created an analysis sample to limit my analysis to those students
without missing data on certain variables and who are present during
our years of interest (years 2 & 3) for at least one year. When I
codebook ID within this sample I get about 28K unique IDs. I've
confirmed this number by using sum with this sample by year.
When I run xtmixed (code below) it says that there are 30236 unique
students (based on the same ID variable) contributing between 1 & 3
years to the data. The if statement appears to work, because it keeps
the numbers consistent between my conditional and unconditional models
(before adding the statement it was not consistent). I've never before
*gained* observations from codebook to analysis and I'm extremely
puzzled. Can anyone help?
Code for unconditional model:
xtmixed SSMATH c_grade || MINDSH: c_grade || ssid: c_grade if
atleastoneyear == 1 & analysissample == 1, mle var cov(un)
Output:
Mixed-effects ML regression Number of obs = 56871
-----------------------------------------------------------
| No. of Observations per Group
Group Variable | Groups Minimum Average Maximum
----------------+------------------------------------------
MINDSH | 52 433 1093.7 1985
ssid | 30236 1 1.9 3
-----------------------------------------------------------
Thank you for your help!
Teya
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/