Announcement

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

  • Am I using the mixed or random effects model correctly in panel data?

    I have a dataset of individuals across three waves where I consider the effect of unemployment on health for mothers. Initially I examined this relationship in a random effects model as follows:


    Code:
    xtreg no_cigs_cons_more0_y psum_unemployed_total_cont_y i.year i.own_education_y i.maritalstatus_y i.medical_card_y i.employment_y i.ord_age_y if has_y0_questionnaire==1 &  has_y5_questionnaire==1 | has_y0_questionnaire==1 & has_y10_questionnaire==1 | has_y0_questionnaire==1 & has_y5_questionnaire==1 & has_y10_questionnaire==1, cluster (current_county_y1) re robust

    There is some evidence to suggest that the results may biased due to attrition, and thus that the effects of unemployment on health may be underestimated. To address this issue I would like to utilize Inverse Probability Weighting (IPW). However, it seems almost impossible to estimate a random effects model with weights.

    A user suggested that using -mixed- instead of -re- would allow the use of different kinds of weights and estimate random effects.

    I decided to re-run my analysis as above but with mixed as below, where I have the mothers id (id) and the geographic area that they live in (current_county_y1):

    Code:
    mixed no_cigs_cons_more0_y psum_unemployed_total_cont_y i.year i.own_education_y i.maritalstatus_y i.medical_card_y i.employment_y i.ord_age_y || id: || current_county_y1: if has_y0_questionnaire==1 &  has_y5_questionnaire==1 | has_y0_questionnaire==1 & has_y10_questionnaire==1 | has_y0_questionnaire==1 & has_y5_questionnaire==1 & has_y10_questionnaire==1

    Could someone please advise me if my linear mixed effects models is correct, i.e. does it match the earlier RE model? In the above everything is measured across all three waves except for education which is only measured in wave 1, I also wasnt sure if where I placed year (which refers to each wave) was ok?

    Also would it be acceptable to use this model in my analysis instead of the random effects model from earlier and how does this differ from earlier?

    I have read the below sources but I feel I need a more simplified explanation as to how the random effects, fixed effects and mixed effects estimators differ and what is the justification for using a mixed estimator?

    For example all of the below suggest that mixed models are characterized as containing both fixed and random effects.:

    Multilevel/ Mixed Effects Models: A Brief Overview https://www3.nd.edu/~rwilliam/stats3/Multilevel.pdf

    Multilevel Mixed (hierarchical) models fmwww.bc.edu/EC-C/S2013/823/EC823.S2013.nn07.slides.pdf

    https://www.stata.com/manuals13/meme.pdf

    Does this mean that by running a mixed effects model I no longer need to choose between a random effects or a fixed effects with a Hausman? It sounds like I am effectively getting the best of both worlds and including both effects in one model.

    I have found my reading online confusing and really just need a simplified explanation of the above, for example my area is health economics and I'm not even sure if this type of model is acceptable in my discipline.

    Kindest regards,

    John


  • #2
    John:
    I think that reading the following textbook can contribute to ease your concerns about the difference between -re- and -mixed- (all in all, -mixed- are pretty similat to -re- with the -mle- option):
    https://www.stata.com/bookstore/mult...lain-language/
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Could someone please advise me if my linear mixed effects models is correct, i.e. does it match the earlier RE model?
      Why not do the comparison yourself? As mixed can often take a long time to run, I would simplify the models first, but that's up to you. One difference between the two models is that you cluster on county in xtreg but not in mixed.. Before the if expressions in mixed, add:
      Code:
      , vce(cluster current_county_y1)
      Be sure to report back what you find.
      Last edited by Steve Samuels; 22 Aug 2018, 12:05.
      Steve Samuels
      Statistical Consulting
      [email protected]

      Stata 14.2

      Comment


      • #4
        Does this mean that by running a mixed effects model I no longer need to choose between a random effects or a fixed effects with a Hausman?
        No. You'll still need to choose between the two types of effects.

        Paul Allison's says in his book "Fixed Effects Regression Methods for Longitudinal Data Using SAS":

        "The name “fixed effects” is a source of considerable confusion. As we shall see, the basic idea is very simple. Consider the linear model

        \[
        Y_{ij} =\beta_0+\beta_1 x_{ij}+ \alpha_i+\epsilon_{ij}
        \]

        where the i subscript refers to different persons and j refers to different measurements within persons―i.e., the same variable measured at different points in time. In conventional linear model terminology, \( \beta_1 x_{ij}\) is described as a fixed effect because the \(x_{ij}\) terms are all measured values and \( \beta_1 \) is a fixed parameter. On the other hand, \(\epsilon_{ij}\) is regarded as a random variable\(\ldots\) So the typical linear model has both fixed components and random components\(\ldots\)

        What about the term \(\alpha_i\), which we use to represent all stable characteristics of persons? Here we have an important choice between treating \(\alpha_i\), as either fixed or random\(\ldots\).

        In fixed effects models the \(\alpha_i\) term is treated as a set of fixed parameters, which may either be estimated directly or conditioned out of the estimation process. Hence the name, “fixed effects.”
        END ALLISON QUOTE

        xtreg, fe fits this fixed effects model after doing the within transformation, i.e.by demaning the variables.

        mixed can fit this fixed-effect model with the \(\alpha_i\) if you:

        1) Demean the covariates by hand, or
        2) Add dummy (indicator variables) for individuals. That is, add to the list of covariates the id variables
        Code:
         i.idcode
        You have at least 1,000 individuals, judging from your output in https://www.statalist.org/forums/for...bility-weights.
        If you choose the second approach, there will be 1,000 extra lines in the output.

        Note: I don't know if mixed can do a Hausman test.
        Last edited by Steve Samuels; 23 Aug 2018, 11:57.
        Steve Samuels
        Statistical Consulting
        [email protected]

        Stata 14.2

        Comment

        Working...
        X