Announcement

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

  • Difference between mixed and fe

    Hi all, I am trying to understand the difference between -mixed- models and using -,fe- in Stata, while also acknowledging that Stata is not my default software programming language, so please bear with me.

    Imagine a very simplified version of my dataset below, where I have an outcome variable and a main predictor variable (x1) along with a second covariate (x2). My data are structured where I have 3 waves of observations for a given person_id, and some families (fam_id) have multiple persons, hence nesting within family.

    My initial impression is that, when using the following code:
    Code:
    mixed outcome x1 x2 i.wave || fam_id: || person_id:
    This is estimating a multilevel model with fixed and random effects, where observations nested within persons, which are themselves nested within families. And while it is including an indicator for wave, it is not a longitudinal model, in the sense that it is not estimating wave-by-wave changes in the predictor and outcome within a given person_id.

    Is that generally correct?

    Whereas, in order to estimate a traditional longitudinal fixed effects model, I would specify in Stata:
    Code:
    xtset wave person_id
    xtreg outcome x1 x2, fe
    Is this generally correct? And is there anything I'm missing, either in terms of the syntax of Stata or the explanation of differences between the types of models?


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input byte(wave person_id fam_id outcome x1 x2)
    1  1 1  2 0 1
    1  2 1  2 0 1
    1  3 2  5 1 0
    1  4 3  7 1 0
    1  5 4  3 0 0
    1  6 4  1 0 0
    1  7 4  4 0 0
    1  8 5  4 0 1
    1  9 6  5 0 0
    1 10 6  2 0 0
    1 11 7  4 0 0
    1 12 8  3 0 0
    2  1 1  3 1 1
    2  2 1  5 1 1
    2  3 2  6 0 0
    2  4 3  5 0 0
    2  5 4  4 0 1
    2  6 4  2 0 1
    2  7 4  7 0 1
    2  8 5  7 1 1
    2  9 6  2 0 0
    2 10 6  5 0 0
    2 11 7  2 0 0
    2 12 8  2 1 1
    3  1 1  4 0 1
    3  2 1  4 0 1
    3  3 2  7 1 0
    3  4 3  9 1 1
    3  5 4  8 1 1
    3  6 4  3 1 1
    3  7 4  7 1 1
    3  8 5 10 1 1
    3  9 6  4 0 0
    3 10 6  6 0 0
    3 11 7  4 0 0
    3 12 8  5 0 0
    end

  • #2
    I agree with all your interpretations, except "...it is not a longitudinal model, in the sense that it is not estimating wave-by-wave changes in the predictor and outcome within a given person_id." I'm not sure what you're trying to say here. It is, without question, a model of longitudinal data. Because it contains an i.wave term in the fixed effects, it also allows for differences in the overall level of outcome across the three waves. To my mind, that's more than enough to qualify it as a "longitudinal model." What it does not do is allow for the effects of the x variables to differ across the three waves, nor does it allow for the wave effects to be person- or household-specific. But, in my experience, at least, it is uncommon to see models that include all of those things--estimating that many parameters gets dicey, and those parameters, even if easily estimable, are not always of any interest.

    Comment


    • #3
      Thank you for the reply. I suppose I was trying to make more explicit the difference between what one might think of as "longitudinal" in the -mixed- model versus what longitudinal means in the -fe- model.

      Comment


      • #4
        Well, there is one other sense in which the -fe- model is longitudinal and the -mixed- model is not. Let's focus on one of the key variables, say x1. In a data set of this type, x1 can be associated with outcome in two different ways. There is, on the one hand, the difference in outcome that is seen in association with a within-person change in x1 over time. This is the within-person effect of x1. On the other hand, unless x1 is randomly assigned or in some other way known to be exogenous, there can also be average differences in outcome at all times associated with the different values of x1 that different people happen to have. This is the between-person effect of x1.

        The -fe- model estimates only the within-person effect. Since the within-person effect is by definition an effect that occurs purely over time within persons, it could be called a longitudinal effect (although, frankly, I can't recall ever seeing it called that.) By contrast, the -mixed- model estimates a weighted average of the within- and between-person effects, so it is not purely longitudinal in this sense of the term.

        Perhaps this is what you have in mind?

        Comment


        • #5
          Yes that is indeed a much more eloquent way of putting what I was attempting to clarify: the fact that the -mixed- model is an average of within/between and is not purely longitudinal. I think the word "purely" is what I was missing in my original statement. I am glad I think I understand how these two pieces of syntax work for Stata.

          Comment

          Working...
          X