Bookmark and Share

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: minimum number of obs for xtmixed


From   "Miller, Daniel P" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: minimum number of obs for xtmixed
Date   Thu, 9 Jun 2011 10:12:01 -0400

Hello all -

I am running a multi-level growth curve model using xtmixed of the sort:

xi: xtmixed y i.x*time i.x*time2 $covariates || id:time time2, var mle

where x is my main categorical independent variable interacted with time [time] and time-squared [time2].
There are as many as four waves of data for each respondent, although there is a good deal of missing data.

My question is about the minimum number of observations reported by xtmixed= .

The model results provide the following:

Mixed-effects ML regression                     
Number of obs      = 31082
Group variable: id                             	Number of groups   = 8506

                                                   Obs per group: min = 1
                                                                  avg = 3.7
                                                                  max = 4

How can a "group" (person) contribute 1 observation to the model?

When I create a variable to measure the number of observations, I get different but more sensible results:

After running the model, I create a flag:
gen insample=1 if e(sample)

Then:
sort id
by aid: gen count =_N if insample==1
(34045 missing values generated)

. tab count

      count |      Freq.     Percent        Cum.
------------+-----------------------------------
          2 |        581        1.87        1.87
          3 |      6,903       22.21       24.08
          4 |     23,598       75.92      100.00
------------+-----------------------------------
      Total |     31,082      100.00

Which would seem to indicate that the minimum number of observations is 2, but most people contributed 3 or 4.

Thanks much in advance,

Dan Miller
Boston University

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index