Announcement

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

  • #16
    You might be interested in reading about time-varying exposures, time-varying confounding, marginal structural models, g-estimation... see, for example, http://isites.harvard.edu/fs/docs/ic..._12jun07-1.pdf

    Comment


    • #17
      Yes, clinic adherence is a dichotmous variable. Wouldn't I need to add it to the random effect portion of the models since we know that it varies across time?

      Code:
      mixed cd4_count c.time c.time#c.time i.trtgrp i.clnadh i.trtgrp#c.time i.trtgrp#c.time#c.time i.trtgrp#clnadh i.clnadh#i.trtgrp#c.time i.clnadh#i.trtgrp#c.time#c.time race_cat gender_cat yearshiv iov age  || mrn: time time2 trtgrp clnadh, cov(un)
      Regarding interpretation, I would focus on the interaction terms for clnadh with trtgrp, trtgrpXtime and trtgrpXtime2 correct? Given it is looking at 4 quadratic growth models, I want to make sure I understand the coefficients. For example, trtgrp*clnadh (coded 1 1) 6.14 is not significant. trtgrp*clnadh*time (coded as 1 0) is 9.63 and not significant but when coded (1 1) then 27.48 and significant. trtgrp*clnadh*time*time coded (1 0) is 0.1 and not significant but when coded (1 1) it is -4.66 and significant. Doesn't seem to me that it is comparing across all 4 groups (with trtgrp and clnadh coded as zeroes and the referent groups). How does one go about interpreting these coefficients?

      Comment


      • #18
        No. Variation across time is not the issue, and, in fact, has nothing to do with whether it belongs in the random effects part of the model.

        The question is whether the effect of clinic adherence (not the level of clinic adherence) on cd4 count varies from one person to the next. Now, in one sense, it almost goes without saying that that effect will vary from person to person. So you could make an argument for including not just clinic adherence, but also adding in a new interaction of clinic adherence with everything else in the model, and including those terms (or, rather, hand created versions of them) in your random effects portion as well.

        But you have to be practical. Is it a huge effect? And even if it is, does it matter for your purposes to quantify it in detail? A model with four level interactions and an enormous array of random intercepts and slopes is going to drown you in output--assuming it doesn't just leave Stata spinning its wheels on an over-specified, under-identified model that fails to converge. Assuming you get results, it will be very difficult to interpret what is going on with any of your variables, and there will be so many dimensions that at this point graphs will be of only limited help. So unless there is a compelling reason to go there, I would avoid it. The whole point of modeling is to provide a simplified view of reality that captures the essential elements that are relevant for your purposes. Adding unnecessary complexity defeats the purpose.

        As an aside, while it is perfectly legal Stata syntax to spell out a multiway interaction by specifying the main effects, the sub-maximal level interactions and the highest level interaction all separately, it's just all to easy to leave something out by mistake. And the code quickly becomes difficult to read. So the simpler way to code this is:
        Code:
        mixed cd4_count i.cln_adh##i.trtgrp##c.time##c.time /* covariates here */ || sub: /*whatever random effects are needed here*/
        Using the ## notation, Stata will automatically spell out all of the sub-interactions and main effects for you. Doing it this way saves you time and keystrokes, makes your code more readable, and reduces the likelihood you will do it wrong.

        Added: In showing you this code for a four way interaction, I am not recommending that you actually implement it. My instinct is that it would be best to just add i.cln_adh alone, or i.cln_adh##i.trtgrp (to the bottom level of the model only, not to the random effects). I'm just showing you a safer way to proceed to that level of complexity if you decide you need to go there.
        Last edited by Clyde Schechter; 20 Feb 2017, 15:55.

        Comment


        • #19
          dear Clyde, dear stata list

          mixed cd4 i.trtgrp##c.time#c.time || id: time time2 , cov(un)

          I run the same type of model.
          outcome (growth) continuous and time as a quadratic term in interaction with a covariable. And also time as a random slope.

          My question is simple:
          do we consider time as a fixed effect, random effect of both?
          thanks for your valuable help!

          Comment


          • #20
            Does the fact that one must always look at the joint significance test of quadratic and linear time also apply to a 2-level mixed model situation where you have a time-invariant covariate (like a medical diagnosis)? Just like when you have a time-varying covariate?

            Comment

            Working...
            X