Announcement

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

  • Generating between and within variables in linear mixed models longitudinal analysis

    Hi!
    I have a longitudinal analysis with lots of time-varying covariates. I have made both between and within variables of these covariates. This was done like this:
    Code:
    *Make within (wp) and between (bp) variables of the variable noise::
    egen noise_bp = mean(noise), by(ID) /*This variable now represents the between persons effect, the person mean of noise values*/
    *Next, I create a variable that represents the within person effect (each noise score's difference from the person's mean noise value):
    gen noise_wp = noise - noise_bp
    I want to look at, among other things, whether the association between age and depvar depends on noise_bp. Let us further say that I want to see whether depvar differs for different levels of noise_bp at age 3 years. The noise_bp contains information from ages 0 through 8, and thus, the variable contains information from a later age than the age in question (age 3). Is this problematic?

    Best,
    Kjell Weyde

  • #2
    This sounds like an unnecessarily complex methodology. If you are interested in the effect of between-person differences in noise exposure at age 3 on your outcome, why don't you simply -keep- only those observations with age = 3 and do your analysis in that data subset. It certainly does seem problematic to draw inferences about age 3 effects from data that is averaged over ages 0 through 8.

    Comment


    • #3
      What I am interested in, is to look at the whole picture, using all observations from age 0 to 8 years (6 obs). So, in that case, I can only draw interences about age 8 years for the noise_bp? But I can still draw inferences about all ages when using noise_wp (within persons)? So, for instance, if I have:
      Code:
      mixed depvar c.age##c.age##c.age##c.noise_bp x1 x2 x3 ......
      and age goes from 0 to 8, all I can say based on that analysis is whether value of depvar at age 8 depends on averaged noise exposure?
      But if I have:
      Code:
      mixed depvar c.age##c.age##c.age##c.noise_wp x1 x2 x3 .....
      that is, the within noise instead, I can draw inferences for every age included?

      My main goal is to be able to say something about whether the relationship between age and depvar depends on noise.

      Comment


      • #4
        With your first command, you are using a variable that, within a person, averages noise exposure over all ages from 0 to 8. So your conclusion is about average noise exposure over those 8 years and you can't really separate out the effects of noise exposure at age 3.

        In your second, you have as your noise variable the deviation between noise at each given age and average noise exposure over ages 0 through 8. This, too, fails to say what is happening at age 3. If you want to know what's going on at age 3, it's

        Code:
        mixed depvar noise x1 x2 x3... if age == 3
        If, in fact, you have only one observation per participant at age each, then you don't even need mixed because you're down to one observation each. So it would actually reduce to:
        Code:
        regress depvar noise x1 x2 x3... if age == 3
        Now, if you want to get very fancy, you can reason that all of these variables exhibit some degree of correlation within person over time, so that observations made at ages other than 3 are still a bit informative about age 3, and by including them you can "borrow strength" and reduce the statistical noise. That's fair. That would be:
        Code:
        mixed depvar c.age##c.age##c.age##c.noise x1 x2 x3...
        margins, dydx(noise) at(age = 3)

        Comment


        • #5
          But if we move away from the focus on age 3, I would like to use my model to say something about whether the association between age and depvar depends on noise (whether the Development of depvar depends on noise). Can't I just use the
          Code:
          mixed depvar c.age##c.age##c.age##c.noise_wp x1 x2 x3 .....
          and then
          Code:
          margins, dydx(noise_wp) at(age=(0 18 36 60 84 96)) atmeans
          to say something about whether depvar depends on noise_wp at the different ages?

          Comment


          • #6
            Well, no, not really. By construction, noise_wp = noise - noise_bp, and noise_bp = mean noise exposure for this person over 8 years. So noise_bp is not defined and does not exist until the person achieves age 8. So noise_wp does not exist and is not defined until the person achieves age 8. So while you can run those commands, the results are uninterpretable as effects at earlier ages because you can't have a cause that doesn't exist until long past the effect.

            Comment


            • #7
              I see your point. Perhaps a better approach in my case, then, is to use the noise variable in its original form, or, I could make two other variabes of noise: one that contains the average noise up until every age point in the model to investigate cumulative effects of noise (for example, noise at time 0=averaged noise between age 0 and 1; noise at time 1=averaged noise from age 0 to 2, and so on), and one that takes into account the change in noise exposure from one time point to the next (change at time 0 = noise at age 1 - noise at birth, change at time 1 = noise at age 2 - noise at age 1, and so on) .

              Comment


              • #8
                I read a paper by Hoffman and Stawski (Hoffman, Lesa and Stawski, Robert S., "Persons as Contexts: Evaluating Between-Person and Within-Person Effects in Longitudinal Analysis" (2009). Faculty Publications, Department of Psychology. Paper 415.)
                where they seem to have used an approach not very different from that I described in post #1. The authors used negative mood as a time-varying covariate

                In person-mean-centering (otherwise known as group-mean-centering when employed with clustered data), the person mean of the time-varying predictor is subtracted from the original timevarying
                predictor, such that the new time-varying predictor represents variation about one’s own mean level. (...) Under person-mean-centering, the Level-2 effect of person mean negative mood (γ04) becomes the total between-person effect. (...) These parameters can be interpreted as follows. The significant between-person effect (γ04) of 0.29 indicates that for every unit higher of person mean negative mood, 0.29 more symptoms are reported on average (for both age groups so far). The significant within-person effect (γ20) of 0.05 indicates that for every unit more negative mood than usual, 0.05 more symptoms than usual are reported.

                Comment


                • #9
                  I think the approach you propose in #7 makes sense.

                  Regarding #8, well, you can find all sorts of things in the literature. That doesn't necessarily mean they make sense or are correct. There is also the issue of context. I have, in my work, also used person-mean centered versions of time-dependent variables and the deviations from them, but only in a context when all of the times involved precede (or, at worst are concurrent with) the outcome. That is the crucial difference. If you were using this to model the value of a dependent variable at a time period at or after 8 years, I would agree with the approach. But I still feel it makes no sense to predict or model an outcome at age 3 from variables that cannot be measured and calculated until age 8.

                  Added: I did not check the reference you cited in #8 because it is not available to me, so my comments here are not specifically directed towards that paper.

                  Comment


                  • #10
                    Clyde:
                    if your interest in the paper still holds: http://digitalcommons.unl.edu/cgi/vi...xt=psychfacpub
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      Thanks, Carlo.

                      I've briefly read this paper now. My reaction is two fold. On the one hand, I agree that within- and between- person effects can be quite different and that it is often necessary to represent them separately in multi-level modeling. But I remain very skeptical of using within-person mean of a time-varying variable for that purpose if the outcome being modeled is measured at a time that precedes any of the times of the measurements that are included in that within-person mean. In this paper they do just that, and I don't buy it. I would be perfectly happy with it if the outcome being measured were measured only after the measurements of the predictor variables, or if they used some different measurement to assess the between-person variation of the traits. For example, there are measure of trait anxiety (distinct from state anxiety)--perhaps there are similar measures that could be used for the long-term characteristics they are modeling in that paper. I remain skeptical.

                      Comment

                      Working...
                      X