Announcement

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

  • Generating individual adjusted values after a mixed command

    Hello all.

    I have run the following code:

    PHP Code:
    mixed whole_brain_mu group##scan age sex || id:, var noconst residuals(unstr, t(scan)) reml dfmethod(kroger) 
    in which whole_brain is an MRI outcome variable (continuous)
    scan is scan in time (T1, T2 and T3)
    and group is an intervention (control/intervention)

    I am controlling for random effects at the level of the individual (ID).

    After I have fitted this model, I get a significant interaction effect between scan and group:

    PHP Code:
    contrast group##scan 
    meaning that the MRI measures over time depends on what group they were assigned to.

    What I would like to obtain is adjusted values for each participant, so I can plot them. That is, adjusted for the effects of age, sex and other between group variances. Is that possible? I realize that the predict is not useful in this particular case.

    Presumably I have to do something with the coefficients via gen, but I am not sure how this is achieved.

    Thanks very much

  • #2
    I realize that the predict is not useful in this particular case.
    Why isn't it useful? You can get exactly what you're describing with
    Code:
    predict wanted, fitted

    Comment


    • #3
      Originally posted by Clyde Schechter View Post
      Why isn't it useful? You can get exactly what you're describing with
      Code:
      predict wanted, fitted
      Thanks Clyde.

      That is what I had done originally (for research question 1 - does change in MRI values change over time with intervention)?

      Question 2 is does change in cognition change over time with intervention?

      However, for our research question 3, we are then looking at the association between changes between T1 and T2 in MRI values, and with changes in cognition between T1 and T2. i.e., we want to say whether there is a significant association between the two.

      So when I use the predict command as stated before, the values are different, but the differences between T1 and T2 are the same for every participant (i.e. the value is 0.117). Hope that makes sense!

      To look at association with changes in both MRI and cognition, we are using a multivariate regression model (code from the help of another stata user):

      whole_brain MRI = bmu
      cognition = fl_inc

      PHP Code:
      quietly sem ///
                  
      (bmu? <- trt sex@a age@b///
                  
      (fl_inc? <- trt sex@c age@d), ///
                  
      method(mlmv///
                  
      covstructure(e._OEnunstructured
      PHP Code:
      //Treatment x time interaction
       
      test ///
                  
      (_b[bmu1:trt] = _b[bmu2:trt]) ///
                  
      (_b[bmu1:trt] = _b[bmu3:trt]) ///
                  
      (_b[fl_inc1:trt] = _b[fl_inc2:trt]) ///
                  
      (_b[fl_inc1:trt] = _b[fl_inc3:trt]) ///
                 
                  
      semcoeflegend 
      PHP Code:
      // Ratios
      // Diff between TP1 and TP2
       
       
      nlcom ///
      Control: (_b[fl_inc2:_cons] - _b[fl_inc1:_cons]) / (_b[bmu2:_cons] - _b[bmu1:_cons]) ) ///
       
      Experimental: (_b[fl_inc2:_cons] + _b[fl_inc2:trt] - _b[fl_inc1:_cons] - _b[fl_inc1:trt]) / ///
      (_b[bmu2:_cons] + _b[bmu2:trt] - _b[bmu1:_cons] - _b[bmu1:trt]) ),
       
      noheader post 
      So my follow up questions are:

      1) How can we get individual values that will have adjusted change scores? Like I said, this will be for a graph where we want to show a high and significant ratio for the intervention group, whereas the controls were not significant in this ratio.
      2) Also, do you know what units the "ratio" should be reported in? stata says coefficient, but I dont think it would be a beta?

      Thanks so much



      Comment


      • #4
        However, for our research question 3, we are then looking at the association between changes between T1 and T2 in MRI values, and with changes in cognition between T1 and T2. i.e., we want to say whether there is a significant association between the two.
        So the problem is not with -predict-. Its behavior, producing a constant value when you subtract the T1 prediction from the T2 prediction is precisely what it should do.

        The problem is that your question 3 requires a different model. You need to calculate the changes between T1 and T2 in MRI values and in cognition, and build a regression model of one of them on the other. Or, really, it sounds like you are looking for a partial correlation, for which there is the -pcorr- command.

        Comment


        • #5
          Originally posted by Clyde Schechter View Post
          So the problem is not with -predict-. Its behavior, producing a constant value when you subtract the T1 prediction from the T2 prediction is precisely what it should do.

          The problem is that your question 3 requires a different model. You need to calculate the changes between T1 and T2 in MRI values and in cognition, and build a regression model of one of them on the other. Or, really, it sounds like you are looking for a partial correlation, for which there is the -pcorr- command.
          Thanks for your reply, Clyde.

          I am not exactly sure what you mean about how question 3 requires a different model. After a very lengthy discussion with Joesph Coveney, we decided to go for this particular model - see here: https://www.statalist.org/forums/for...effects-models

          and look at ratios with nlcom. I think this was suggested because of the small sample size. Are you suggesting a different approach entirely?

          Comment


          • #6
            Well, looking briefly at the thread you had with Joseph Coveney, it seems you resolved the problem of estimating the population-level ratio of changes there. So now I don't understand what the question in this thread is.

            You asked at the beginning of this thread for a way to predict individual-level adjusted values from the mixed effects models, and that was answered in #2. In #3 you then asked how you can get individual-level values for adjusted change scores. I don't think you can get those from the original model: that is a different matter from whether you can get estimates of the population-level change ratio--you worked that out in the thread with Joseph Coveney. I'm not sure why you want to get adjusted change scores at the individual level, but if you want them, I think you have to do a model with change as the outcome variable.

            Comment

            Working...
            X