Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Identify excluded observations from mixed

    I'm working with longitudinal panel data and running models using the mixed command. In prepping the data, I excluded individuals who did not complete at least two time points of data collection (each person should've done 2 or 3 time points, not 0 or 1). Further, I thought I cleaned so subjs missing the covariates of interest were also dropped.

    However, when I run my mixed model I get:
    Code:
    Number of observations = 7,499 
    Number of groups = 3,290 
    
    Obs per group: 
    min = 1 
    avg = 2.3 
    max = 3
    I would've expected it to be 3,290 "groups" (aka subjects) but then min of 2 observations per group (per person) and max of 3.

    Is there a simple way I can identify (in this relatively large dataset) for which subjects only 1 of the time points was being included in the model?


  • #2
    Try something like this after fitting the model.
    Code:
    keep if e(sample)
    contract individual_id, freq(count)
    keep if count == 1
    list, noobs
    (Be sure to save your dataset first.)

    Comment


    • #3
      Thank you Joseph!! This fixed my issue.

      Comment

      Working...
      X