Announcement

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

  • Analyzing change with linear mixed effects models

    Hi,

    I am hoping someone can help me.

    I am looking at the effect of acute exercise on brain structure over time.

    I have 30 subjects, split into 2 groups: Exercise (N=20) and Control (N=10)

    In all subjects, there was a MRI scan (and cognitive tests) (1) immediately before, (2) immediately after, and (3) 1 hour after the Activity Block (exercise, or rest for controls).

    In my first aim, I wanted to see whether brain changes were different between groups (Exercise vs control) over time (scan [factor variable, time1,2,and 3]) and ran a linear mixed model:

    xtmixed whole_brain_mu group##scan i.sex c.age || id:, var noconst residuals(unstr, t(scan)) reml
    contrast group##scan

    This provides a significant interaction between group and time, as expected: F2,39.22 = 13.31, p = .0010

    I then wanted to see whether there was an interaction between group and time on cognitive performance:

    xtmixed flanker_inc_rt group##scan i.sex c.age || id:, var noconst residuals(unstr, t(scan)) reml
    contrast group##scan

    which there was: F2,35.30 = 11.00, p = .0041

    What I now want to do, is analyse whether the changes observed in brain structure are related to the changes observed in cognition, and whether this differs by group.

    One option was to perform a regression and calculate difference scores between scan 1 and scan 2 in brain structure, and calculate difference scores between scan 1 and scan 2 in cognition. But then I am missing the effects of scan 3 (presumably everything returning to baseline).
    I also am not sure how this design would consider between-subject and within-subject effects (as in the first lines of code).

    Any advice would be much appreciated.

    Thanks,
    Lucy


    Data below:

    input byte(id group sex) double age byte scan double whole_brain_mu int flanker_inc_rt
    1 1 1 19.65 1 2.779 611
    1 1 1 19.65 2 2.8865 .
    1 1 1 19.65 3 2.938 552
    2 1 0 19.79 1 2.8303 515
    2 1 0 19.79 2 2.706 .
    2 1 0 19.79 3 2.8309 534
    3 1 0 22.47 1 2.8026 509
    3 1 0 22.47 2 2.6632 .
    3 1 0 22.47 3 2.8266 459
    4 1 1 20.53 1 3.0665 597
    4 1 1 20.53 2 2.9192 .
    4 1 1 20.53 3 2.8305 560
    5 0 1 20.54 1 2.8067 577
    5 0 1 20.54 2 2.9067 .
    5 0 1 20.54 3 2.7982 597
    6 1 1 24.39 1 2.7701 649
    6 1 1 24.39 2 2.5172 .
    6 1 1 24.39 3 2.7511 542
    7 1 1 22.34 1 2.6797 586
    7 1 1 22.34 2 2.5227 .
    7 1 1 22.34 3 2.71 576
    8 1 0 19.1 1 2.847 525
    8 1 0 19.1 2 2.7707 482
    8 1 0 19.1 3 2.8263 521
    9 1 0 19.63 1 2.7862 561
    9 1 0 19.63 2 2.7173 519
    9 1 0 19.63 3 2.8551 525
    10 1 1 23.38 1 2.6764 635
    10 1 1 23.38 2 2.51 .
    10 1 1 23.38 3 2.6415 612
    11 1 1 24.8 1 2.8238 808
    11 1 1 24.8 2 2.6421 669
    11 1 1 24.8 3 2.8527 652
    12 1 1 24.27 1 2.7843 502
    12 1 1 24.27 2 2.678 490
    12 1 1 24.27 3 2.7973 478
    13 0 1 21.33 1 2.7188 526
    13 0 1 21.33 2 2.6568 495
    13 0 1 21.33 3 2.7556 506
    14 1 1 21.18 1 2.6368 454
    14 1 1 21.18 2 2.5191 484
    14 1 1 21.18 3 2.6911 468
    15 0 1 21.96 1 2.515 534
    15 0 1 21.96 2 2.5181 477
    15 0 1 21.96 3 2.5438 459
    16 1 1 21.84 1 2.708 530
    16 1 1 21.84 2 2.5153 517
    16 1 1 21.84 3 2.7338 505
    17 1 0 23.21 1 2.8715 487
    17 1 0 23.21 2 2.6165 424
    17 1 0 23.21 3 2.8309 463
    18 1 0 26.42 1 2.7411 552
    18 1 0 26.42 2 2.6225 491
    18 1 0 26.42 3 2.8017 480
    19 0 0 23.3 1 2.9521 593
    19 0 0 23.3 2 2.7254 585
    19 0 0 23.3 3 2.8178 514
    20 0 0 20.99 1 2.5776 640
    20 0 0 20.99 2 2.6514 676
    20 0 0 20.99 3 2.6365 621
    21 0 0 27.13 1 2.6038 514
    21 0 0 27.13 2 2.6092 506
    21 0 0 27.13 3 2.6431 557
    22 1 0 19.42 1 2.6777 540
    22 1 0 19.42 2 2.4152 464
    22 1 0 19.42 3 2.5506 515
    23 0 1 21.33 1 2.4942 537
    23 0 1 21.33 2 2.5842 559
    23 0 1 21.33 3 2.5922 546
    24 1 0 20.15 1 2.723 593
    24 1 0 20.15 2 2.7915 517
    24 1 0 20.15 3 2.7408 522
    25 0 0 30.36 1 2.9172 534
    25 0 0 30.36 2 2.8434 536
    25 0 0 30.36 3 2.871 510
    26 1 0 26.49 1 2.9862 523
    26 1 0 26.49 2 2.8391 454
    26 1 0 26.49 3 2.9984 508
    27 1 1 22.32 1 2.6267 508
    27 1 1 22.32 2 2.6333 484
    27 1 1 22.32 3 2.8271 483
    28 1 1 25.21 1 2.6864 465
    28 1 1 25.21 2 2.6786 463
    28 1 1 25.21 3 2.717 533
    29 0 0 23.04 1 2.6642 480
    29 0 0 23.04 2 2.6514 493
    29 0 0 23.04 3 2.6606 489
    30 0 0 25.84 1 2.8856 514
    30 0 0 25.84 2 2.8253 494
    30 0 0 25.84 3 2.8116 456
    end
    label values group labels0
    label def labels0 0 "Control", modify
    label def labels0 1 "Exercise", modify
    label values sex labels1
    label def labels1 0 "Male", modify
    label def labels1 1 "Female", modify
    [/CODE]

  • #2
    Originally posted by Lucy Hiscox View Post
    What I now want to do, is analyse whether the changes observed in brain structure are related to the changes observed in cognition, and whether this differs by group.
    You could compute the change scores and plot them by group for each of the posttreatment time points. Perhaps something like the following.
    Code:
    bysort id (scan): generate double dbu = whole_brain_mu - whole_brain_mu[1]
    by id: generate double dfr = flanker_inc_rt - flanker_inc_rt[1]
    graph twoway ///
        lfit dfr dbm if scan == 2 & !group, lpattern(dash) lcolor(blue) || ///
        scatter dfr dbm if scan == 2 & !group, msymbol(circle) mcolor(blue) msize(small) || ///
        lfit dfr dbm if scan == 2 & group, lpattern(dash) lcolor(red) || ///
        scatter dfr dbm if scan == 2 & group, msymbol(triangle) mcolor(red) msize(small) ///
            ytitle(Change Flanker RT) ylabel( , angle(horizontal) nogrid) ///
            xtitle(Change in MRI Mu) legend(off)
    You'd do the same for the third time point's change scores.

    You can also fit an omnibus model using -gsem- and then construct nonlinear contrasts using -nlcom- of the ratios of the changes in the two outcome measures for each of the two treatment groups at each of the two posttreatment time points.

    You can also stack the two outcomes and fit an omnibus model using -mixed- and do the same kind of postestimation nonlinear contrasts. If you go this latter route, it might help to avoid potential numerical instability if you re-scale one or both of the outcome measures so that they are approximately similar in scale.

    You're probably aware of the elephant in the room in that you have a large (more than threefold) difference between treatment groups in the proportion of missing cognitive test values at your critical posttreatment time point. You also have a rather small sample size for such an ambitious undertaking as to assess the relationship between changes in the two outcome variables.

    Comment


    • #3
      Thank you Joseph, that is really helpful!

      I haven't worked with sem models before, but would it be something like:

      PHP Code:
        bysort id (scan): generate double diff_wbm whole_brain_mu whole_brain_mu[1]
      by idgenerate double diff_flanker flanker_inc_rt flanker_inc_rt[1]
      gsem diff_flanker <- diff_wbm i.group i.sex c.age 

      PHP Code:

      Iteration 0
      :   log likelihood = -407.31241  
      Iteration 1
      :   log likelihood = -407.31241  

      Generalized structural equation model                       Number of obs 
      82
      Response
      diff_flanker
      Family
      :   Gaussian    
      Link
      :     Identity    
      Log likelihood 
      = -407.31241

      -------------------------------------------------------------------------------------
                          | 
      Coefficient  Stderr.      z    P>|z|     [95confinterval]
      --------------------+----------------------------------------------------------------
      diff_flanker        |
                 
      diff_wbm |   113.5496   48.77085     2.33   0.020     17.96047    209.1387
                          
      |
                    
      group |
                
      Exercise  |     -14.63   8.356435    -1.75   0.080    -31.00831    1.748311
                          
      |
                      
      sex |
                  
      Female  |   .1087983   7.939634     0.01   0.989     -15.4526     15.6702
                      age 
      |  -.7656606   1.472472    -0.52   0.603    -3.651652    2.120331
                    _cons 
      |   10.69633   35.89744     0.30   0.766    -59.66137    81.05402
      --------------------+----------------------------------------------------------------
       var(
      e.diff_flanker)|   1207.819   188.6297                      889.3376    1640.353
      ------------------------------------------------------------------------------------- 

      Comment


      • #4
        p.s. i also have a whole set of cognitive outcomes (not just flanker) and so could possibly combine them all (into a latent variable called "cognition"?)

        Comment


        • #5
          Originally posted by Joseph Coveney View Post

          You can also fit an omnibus model using -gsem- and then construct nonlinear contrasts using -nlcom- of the ratios of the changes in the two outcome measures for each of the two treatment groups at each of the two posttreatment time points.
          So I have tried this code to generate a latent variable for "Cognition" - as had 6 different scores measuring cognitive ability:

          PHP Code:
             gsem (Cognition -> flanker_c_rt ) (Cognition -> flanker_inc_rt, ) (Cognition -> stroop_c_rt, ) (Cognition -> stroop_inc_rt, ) (Cognition -> stroop_effect_rt, ) (Cognition -> sr, ), latent(Cognition startvalues(ivstartgrid 
          I then used the following to get the standardised "Cognitive scores"

          PHP Code:
           foreach v in Cognition {
              
          predict `v', latent(`v')
              egen std_`v'
          std(`v') 
              } 
          Followed by this to get the difference between scan 1 and 2 (brain MRI measure) (top row) and the change in cognition (bottom row):

          PHP Code:
          bysort id (scan): generate double diff_whole_brain_mu whole_brain_mu whole_brain_mu[1]
          by idgenerate double diff_Cognition std_Cognition std_Cognition[1
          I then thought I needed to drop scans 1 and 3 (as data is in long format): drop if scan == 1
          drop if scan == 3. Probably a much more elegant way to do this.

          Ran the gsem as suggested:

          PHP Code:
          gsem (diff_Cognition <- diff_whole_brain_mu group)  (diff_whole_brain_mu <- group
          Before getting the indirect and total effects with nlcom.

          PHP Code:
           gsemcoeflegend 
           nlcom _b
          [diff_Cognition:diff_whole_brain_mu]*_b[diff_Cognition:group]
           
          nlcom _b[diff_Cognition:group]+_b[diff_Cognition:diff_whole_brain_mu]*_b[diff_whole_brain_mu:group
          Sure there might be a few issues, but would really appreciate your advice on how its going so far!
          Thank you,
          Lucy

          Comment


          • #6
            Originally posted by Lucy Hiscox View Post
            Sure there might be a few issues, but would really appreciate your advice on how its going so far!
            Others on the list can chime in, but I don't have much additional to say.

            A couple of observations that you might want to consider:

            1. Your using latent factor predictions as observed data in subsequent regression models could lead to an optimistic estimate of uncertainty. (Also, keep in mind that SEM is a large-sample method.)

            2. In your model, MRI measurements reflect some anatomical phenomenon that acts in this time frame as a mediator of the treatment effect of physical exercise on the questionnaire scores. I guess that you've looked into that presumption and there is literature suggesting that it's more than phrenology. That is, your study might not be powered to evaluate mediation formally.

            3. For -nlcom-, you're computing a product. I was thinking of a ratio (slope) and not a product. A nonzero slope implies an association (cf. the graphs that I suggested).

            In general, it strikes me that this follow-on research question involves too many unknowns chasing after too few data. And that you might have bigger fish to fry in the differential missed-visit rates at the critical time point.

            Comment


            • #7
              Originally posted by Joseph Coveney View Post
              3. For -nlcom-, you're computing a product. I was thinking of a ratio (slope) and not a product. A nonzero slope implies an association (cf. the graphs that I suggested).
              Thanks very much for your advice. I am wondering though, even if we don't go down this analysis route, how it is possible to calculate the ratio or slope? and more importantly, how this can be calculated for each group?

              Comment


              • #8
                Would it be...

                PHP Code:
                nlcom _b[1.group
                but then that is just the slope for exercise versus controls, right? is it possible to get slopes for both?

                Comment


                • #9
                  Originally posted by Lucy Hiscox View Post
                  . . . how it is possible to calculate the ratio or slope? and more importantly, how this can be calculated for each group?
                  You can do something along the lines below, as one possible approach. (Begin at the "Begin here" comment; the stuff above is just exploration and shortening of the variable names for brevity in typing and display of regression output.)

                  Both cognitive test scores and semiquantitative medical imaging results are considered as outcome variables in a bivariate hierarchical regression model with a relatively simple residual covariance structure. The margins (basically sex- and age-adjusted predictions of the two outcome variables' respective means at each time point) are -post-ed, and then -nlcom- is used to compute the change of mean values and take their ratios. I've illustrated the change from pretreatment to immediate posttreatment, but you could do the analogous contrasts for the third time point versus the pretreatment. The slope for the experimental treatment group is 0.0024 ± 0.0010, while the precision for that of the control treatment (0.0042 ± 0.0210) reflects the relative lack of any change for this group.

                  .ÿ
                  .ÿversionÿ17.0

                  .ÿ
                  .ÿclearÿ*

                  .ÿ
                  .ÿquietlyÿinputÿbyte(idÿgroupÿsex)ÿdoubleÿageÿbyteÿscanÿ///
                  >ÿÿÿÿÿÿÿÿÿdoubleÿwhole_brain_muÿintÿflanker_inc_rt

                  .ÿ/*ÿlabelÿvaluesÿgroupÿlabels0
                  >ÿlabelÿdefÿlabels0ÿ0ÿ"Control",ÿmodify
                  >ÿlabelÿdefÿlabels0ÿ1ÿ"Exercise",ÿmodify
                  >ÿlabelÿvaluesÿsexÿlabels1
                  >ÿlabelÿdefÿlabels1ÿ0ÿ"Male",ÿmodify
                  >ÿlabelÿdefÿlabels1ÿ1ÿ"Female",ÿmodifyÿ*/
                  .ÿ
                  .ÿrenameÿidÿpid

                  .ÿ
                  .ÿlabelÿvariableÿsexÿSex

                  .ÿlabelÿdefineÿSexesÿ0ÿMÿ1ÿF

                  .ÿlabelÿvaluesÿsexÿSexes

                  .ÿ
                  .ÿrenameÿgroupÿtrt

                  .ÿlabelÿvariableÿtrtÿ"TreatmentÿGroup"

                  .ÿlabelÿdefineÿTreatmentsÿ0ÿControlÿ1ÿExperimental

                  .ÿlabelÿvaluesÿtrtÿTreatments

                  .ÿ
                  .ÿrenameÿscanÿtim

                  .ÿlabelÿvariableÿtimÿSession

                  .ÿ
                  .ÿrenameÿwhole_brain_muÿbmu

                  .ÿrenameÿflanker_inc_rtÿfrt

                  .ÿ
                  .ÿassertÿ!mi(bmu)

                  .ÿassertÿ!mi(frt)ÿifÿinlist(tim,ÿ1,ÿ3)

                  .ÿ
                  .ÿgenerateÿbyteÿmrtÿ=ÿmissing(frt)

                  .ÿlabelÿvariableÿmrtÿMissing

                  .ÿlabelÿdefineÿNYÿ0ÿNÿ1ÿY

                  .ÿlabelÿvaluesÿmrtÿNY

                  .ÿ
                  .ÿtabulateÿmrtÿtrtÿifÿtimÿ==ÿ2,ÿcolumnÿnokey

                  ÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿTreatmentÿGroup
                  ÿÿÿMissingÿ|ÿÿÿControlÿÿExperimenÿ|ÿÿÿÿÿTotal
                  -----------+----------------------+----------
                  ÿÿÿÿÿÿÿÿÿNÿ|ÿÿÿÿÿÿÿÿÿ9ÿÿÿÿÿÿÿÿÿ13ÿ|ÿÿÿÿÿÿÿÿ22ÿ
                  ÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿ90.00ÿÿÿÿÿÿ65.00ÿ|ÿÿÿÿÿ73.33ÿ
                  -----------+----------------------+----------
                  ÿÿÿÿÿÿÿÿÿYÿ|ÿÿÿÿÿÿÿÿÿ1ÿÿÿÿÿÿÿÿÿÿ7ÿ|ÿÿÿÿÿÿÿÿÿ8ÿ
                  ÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿ10.00ÿÿÿÿÿÿ35.00ÿ|ÿÿÿÿÿ26.67ÿ
                  -----------+----------------------+----------
                  ÿÿÿÿÿTotalÿ|ÿÿÿÿÿÿÿÿ10ÿÿÿÿÿÿÿÿÿ20ÿ|ÿÿÿÿÿÿÿÿ30ÿ
                  ÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿ100.00ÿÿÿÿÿ100.00ÿ|ÿÿÿÿ100.00ÿ

                  .ÿ
                  .ÿtabulateÿtrtÿsexÿifÿtimÿ==ÿ1,ÿrowÿnokey

                  ÿÿÿTreatmentÿ|ÿÿÿÿÿÿÿÿÿÿSex
                  ÿÿÿÿÿÿÿGroupÿ|ÿÿÿÿÿÿÿÿÿMÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿÿÿTotal
                  -------------+----------------------+----------
                  ÿÿÿÿÿControlÿ|ÿÿÿÿÿÿÿÿÿ6ÿÿÿÿÿÿÿÿÿÿ4ÿ|ÿÿÿÿÿÿÿÿ10ÿ
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿ60.00ÿÿÿÿÿÿ40.00ÿ|ÿÿÿÿ100.00ÿ
                  -------------+----------------------+----------
                  Experimentalÿ|ÿÿÿÿÿÿÿÿÿ9ÿÿÿÿÿÿÿÿÿ11ÿ|ÿÿÿÿÿÿÿÿ20ÿ
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿ45.00ÿÿÿÿÿÿ55.00ÿ|ÿÿÿÿ100.00ÿ
                  -------------+----------------------+----------
                  ÿÿÿÿÿÿÿTotalÿ|ÿÿÿÿÿÿÿÿ15ÿÿÿÿÿÿÿÿÿ15ÿ|ÿÿÿÿÿÿÿÿ30ÿ
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿ50.00ÿÿÿÿÿÿ50.00ÿ|ÿÿÿÿ100.00ÿ

                  .ÿversionÿ16.1:ÿtableÿtrtÿifÿtimÿ==ÿ1,ÿcontents(meanÿageÿsdÿage)ÿformat(%4.1f)

                  -------------------------------------
                  Treatmentÿÿÿÿ|
                  Groupÿÿÿÿÿÿÿÿ|ÿÿmean(age)ÿÿÿÿÿsd(age)
                  -------------+-----------------------
                  ÿÿÿÿÿControlÿ|ÿÿÿÿÿÿÿ23.6ÿÿÿÿÿÿÿÿÿ3.2
                  Experimentalÿ|ÿÿÿÿÿÿÿ22.3ÿÿÿÿÿÿÿÿÿ2.4
                  -------------------------------------

                  .ÿ
                  .ÿversionÿ16.1:ÿtableÿtrtÿtim,ÿcontents(p25ÿbmuÿp50ÿbmuÿp75ÿbmu)ÿformat(%3.1f)

                  -------------------------------
                  Treatmentÿÿÿÿ|ÿÿÿÿÿSessionÿÿÿÿÿ
                  Groupÿÿÿÿÿÿÿÿ|ÿÿÿÿ1ÿÿÿÿÿ2ÿÿÿÿÿ3
                  -------------+-----------------
                  ÿÿÿÿÿControlÿ|ÿÿ2.6ÿÿÿ2.6ÿÿÿ2.6
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿ2.7ÿÿÿ2.7ÿÿÿ2.7
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿ2.9ÿÿÿ2.8ÿÿÿ2.8
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿ
                  Experimentalÿ|ÿÿ2.7ÿÿÿ2.5ÿÿÿ2.7
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿ2.8ÿÿÿ2.7ÿÿÿ2.8
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿ2.8ÿÿÿ2.7ÿÿÿ2.8
                  -------------------------------

                  .ÿversionÿ16.1:ÿtableÿtrtÿtim,ÿcontents(meanÿbmuÿsdÿbmu)ÿformat(%3.1f)

                  -------------------------------
                  Treatmentÿÿÿÿ|ÿÿÿÿÿSessionÿÿÿÿÿ
                  Groupÿÿÿÿÿÿÿÿ|ÿÿÿÿ1ÿÿÿÿÿ2ÿÿÿÿÿ3
                  -------------+-----------------
                  ÿÿÿÿÿControlÿ|ÿÿ2.7ÿÿÿ2.7ÿÿÿ2.7
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿ0.2ÿÿÿ0.1ÿÿÿ0.1
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿ
                  Experimentalÿ|ÿÿ2.8ÿÿÿ2.7ÿÿÿ2.8
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿ0.1ÿÿÿ0.1ÿÿÿ0.1
                  -------------------------------

                  .ÿ
                  .ÿversionÿ16.1:ÿtableÿtrtÿtim,ÿcontents(p25ÿfrtÿp50ÿfrtÿp75ÿfrt)ÿformat(%3.0f)

                  -------------------------------
                  Treatmentÿÿÿÿ|ÿÿÿÿÿSessionÿÿÿÿÿ
                  Groupÿÿÿÿÿÿÿÿ|ÿÿÿÿ1ÿÿÿÿÿ2ÿÿÿÿÿ3
                  -------------+-----------------
                  ÿÿÿÿÿControlÿ|ÿÿ514ÿÿÿ494ÿÿÿ489
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿ534ÿÿÿ506ÿÿÿ512
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿ577ÿÿÿ559ÿÿÿ557
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿ
                  Experimentalÿ|ÿÿ509ÿÿÿ464ÿÿÿ482
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿ535ÿÿÿ484ÿÿÿ522
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿ595ÿÿÿ517ÿÿÿ547
                  -------------------------------

                  .ÿversionÿ16.1:ÿtableÿtrtÿtim,ÿcontents(meanÿfrtÿsdÿfrt)ÿformat(%3.0f)

                  -------------------------------
                  Treatmentÿÿÿÿ|ÿÿÿÿÿSessionÿÿÿÿÿ
                  Groupÿÿÿÿÿÿÿÿ|ÿÿÿÿ1ÿÿÿÿÿ2ÿÿÿÿÿ3
                  -------------+-----------------
                  ÿÿÿÿÿControlÿ|ÿÿ545ÿÿÿ536ÿÿÿ526
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿ46ÿÿÿÿ63ÿÿÿÿ55
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿ
                  Experimentalÿ|ÿÿ558ÿÿÿ497ÿÿÿ524
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿ80ÿÿÿÿ58ÿÿÿÿ50
                  -------------------------------

                  .ÿ
                  .ÿ*
                  .ÿ*ÿBeginÿhere
                  .ÿ*
                  .ÿgsemÿ///
                  >ÿÿÿÿÿÿÿÿÿ(bmuÿ<-ÿi.trt##i.timÿi.sexÿc.ageÿM[pid])ÿ///
                  >ÿÿÿÿÿÿÿÿÿ(frtÿ<-ÿi.trt##i.timÿÿi.sexÿc.ageÿM[pid]),ÿ///
                  >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿcovariance(e.bmu*e.frt)ÿ///ÿ<-ÿpossiblyÿomit
                  >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿnocnsreportÿnodvheaderÿnolog

                  GeneralizedÿstructuralÿequationÿmodelÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿ=ÿ90
                  Logÿlikelihoodÿ=ÿ-353.72956

                  ----------------------------------------------------------------------------------
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿCoefficientÿÿStd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
                  -----------------+----------------------------------------------------------------
                  bmuÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿtrtÿ|
                  ÿÿÿExperimentalÿÿ|ÿÿÿ.0781834ÿÿÿ.0450179ÿÿÿÿÿ1.74ÿÿÿ0.082ÿÿÿÿ-.0100501ÿÿÿÿ.1664169
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿtimÿ|
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿÿÿ-.01633ÿÿÿ.0498563ÿÿÿÿ-0.33ÿÿÿ0.743ÿÿÿÿ-.1140465ÿÿÿÿ.0813865
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿÿÿ-.00048ÿÿÿ.0498563ÿÿÿÿ-0.01ÿÿÿ0.992ÿÿÿÿ-.0981965ÿÿÿÿ.0972365
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
                  ÿÿÿÿÿÿÿÿÿtrt#timÿ|
                  ÿExperimental#2ÿÿ|ÿÿÿ-.100635ÿÿÿ.0610612ÿÿÿÿ-1.65ÿÿÿ0.099ÿÿÿÿ-.2203128ÿÿÿÿ.0190428
                  ÿExperimental#3ÿÿ|ÿÿÿÿ.012885ÿÿÿ.0610612ÿÿÿÿÿ0.21ÿÿÿ0.833ÿÿÿÿ-.1067928ÿÿÿÿ.1325628
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿsexÿ|
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿFÿÿ|ÿÿ-.0537931ÿÿÿÿ.026044ÿÿÿÿ-2.07ÿÿÿ0.039ÿÿÿÿ-.1048385ÿÿÿ-.0027477
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿageÿ|ÿÿÿÿ.006762ÿÿÿÿ.004987ÿÿÿÿÿ1.36ÿÿÿ0.175ÿÿÿÿ-.0030123ÿÿÿÿ.0165363
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
                  ÿÿÿÿÿÿÿÿÿÿM[pid]ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
                  ÿÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ2.575575ÿÿÿ.1247786ÿÿÿÿ20.64ÿÿÿ0.000ÿÿÿÿÿ2.331013ÿÿÿÿ2.820136
                  -----------------+----------------------------------------------------------------
                  frtÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿtrtÿ|
                  ÿÿÿExperimentalÿÿ|ÿÿÿÿ6.95232ÿÿÿ22.79377ÿÿÿÿÿ0.31ÿÿÿ0.760ÿÿÿÿ-37.72264ÿÿÿÿ51.62728
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿtimÿ|
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿ-3.849668ÿÿÿ13.04967ÿÿÿÿ-0.30ÿÿÿ0.768ÿÿÿÿ-29.42655ÿÿÿÿ21.72721
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿÿÿÿÿ-19.4ÿÿÿ12.50984ÿÿÿÿ-1.55ÿÿÿ0.121ÿÿÿÿ-43.91884ÿÿÿÿ5.118844
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
                  ÿÿÿÿÿÿÿÿÿtrt#timÿ|
                  ÿExperimental#2ÿÿ|ÿÿÿ-44.0661ÿÿÿ16.64052ÿÿÿÿ-2.65ÿÿÿ0.008ÿÿÿÿ-76.68092ÿÿÿ-11.45127
                  ÿExperimental#3ÿÿ|ÿÿÿÿÿÿ-13.7ÿÿÿ15.32137ÿÿÿÿ-0.89ÿÿÿ0.371ÿÿÿÿ-43.72933ÿÿÿÿ16.32933
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿsexÿ|
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿFÿÿ|ÿÿÿÿ28.3989ÿÿÿ19.66948ÿÿÿÿÿ1.44ÿÿÿ0.149ÿÿÿÿ-10.15257ÿÿÿÿ66.95037
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿageÿ|ÿÿÿ-1.10806ÿÿÿ3.758168ÿÿÿÿ-0.29ÿÿÿ0.768ÿÿÿÿ-8.473934ÿÿÿÿ6.257814
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
                  ÿÿÿÿÿÿÿÿÿÿM[pid]ÿ|ÿÿÿ1810.768ÿÿÿ2227.177ÿÿÿÿÿ0.81ÿÿÿ0.416ÿÿÿÿ-2554.419ÿÿÿÿ6175.955
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
                  ÿÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ559.6707ÿÿÿÿ91.7533ÿÿÿÿÿ6.10ÿÿÿ0.000ÿÿÿÿÿ379.8376ÿÿÿÿ739.5039
                  -----------------+----------------------------------------------------------------
                  ÿÿÿÿÿÿvar(M[pid])|ÿÿÿÿ.000762ÿÿÿ.0018027ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ7.38e-06ÿÿÿÿ.0786421
                  -----------------+----------------------------------------------------------------
                  ÿÿÿÿÿÿÿvar(e.bmu)|ÿÿÿ.0124283ÿÿÿ.0024948ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0083858ÿÿÿÿ.0184194
                  ÿÿÿÿÿÿÿvar(e.frt)|ÿÿÿÿ782.481ÿÿÿ298.1389ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ370.8098ÿÿÿÿ1651.187
                  -----------------+----------------------------------------------------------------
                  ÿcov(e.bmu,e.frt)|ÿÿ-.5663879ÿÿÿ1.584306ÿÿÿÿ-0.36ÿÿÿ0.721ÿÿÿÿ-3.671571ÿÿÿÿ2.538795
                  ----------------------------------------------------------------------------------

                  .ÿ
                  .ÿ//ÿTestÿofÿtreatment-by-timeÿinteraction
                  .ÿestimatesÿstoreÿFull

                  .ÿ
                  .ÿquietlyÿgsemÿ///
                  >ÿÿÿÿÿÿÿÿÿ(bmuÿ<-ÿi.trtÿi.timÿi.sexÿc.ageÿM[pid])ÿ///
                  >ÿÿÿÿÿÿÿÿÿ(frtÿ<-ÿi.trtÿi.timÿÿi.sexÿc.ageÿM[pid]),ÿ///
                  >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿcovariance(e.bmu*e.frt)ÿ///
                  >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿnocnsreportÿnodvheaderÿnolog

                  .ÿlrtestÿFull

                  Likelihood-ratioÿtest
                  Assumption:ÿ.ÿnestedÿwithinÿFull

                  ÿLRÿchi2(4)ÿ=ÿÿÿ9.52
                  Probÿ>ÿchi2ÿ=ÿ0.0493

                  .ÿ
                  .ÿ//ÿOK,ÿsoÿnowÿtheÿindividualÿtreatmentÿgroups'ÿchangeÿratiosÿ(slopes)
                  .ÿestimatesÿrestoreÿFull
                  (resultsÿFullÿareÿactiveÿnow)

                  .ÿmarginsÿtrt#tim,ÿpost

                  PredictiveÿmarginsÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿ=ÿ90
                  ModelÿVCE:ÿOIM

                  1._predict:ÿMarginalÿpredictedÿmeanÿ(bmu),ÿpredict(muÿoutcome(bmu))
                  2._predict:ÿMarginalÿpredictedÿmeanÿ(frt),ÿpredict(muÿoutcome(frt))

                  -----------------------------------------------------------------------------------
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿDelta-method
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿMarginÿÿÿstd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
                  ------------------+----------------------------------------------------------------
                  ÿ_predict#trt#timÿ|
                  ÿÿÿÿÿ1#Control#1ÿÿ|ÿÿÿ2.702494ÿÿÿ.0366114ÿÿÿÿ73.82ÿÿÿ0.000ÿÿÿÿÿ2.630737ÿÿÿÿ2.774251
                  ÿÿÿÿÿ1#Control#2ÿÿ|ÿÿÿ2.686164ÿÿÿ.0366114ÿÿÿÿ73.37ÿÿÿ0.000ÿÿÿÿÿ2.614407ÿÿÿÿ2.757921
                  ÿÿÿÿÿ1#Control#3ÿÿ|ÿÿÿ2.702014ÿÿÿ.0366114ÿÿÿÿ73.80ÿÿÿ0.000ÿÿÿÿÿ2.630257ÿÿÿÿ2.773771
                  1#Experimental#1ÿÿ|ÿÿÿ2.780678ÿÿÿ.0257848ÿÿÿ107.84ÿÿÿ0.000ÿÿÿÿÿ2.730141ÿÿÿÿ2.831215
                  1#Experimental#2ÿÿ|ÿÿÿ2.663713ÿÿÿ.0257848ÿÿÿ103.31ÿÿÿ0.000ÿÿÿÿÿ2.613176ÿÿÿÿÿ2.71425
                  1#Experimental#3ÿÿ|ÿÿÿ2.793083ÿÿÿ.0257848ÿÿÿ108.32ÿÿÿ0.000ÿÿÿÿÿ2.742546ÿÿÿÿÿ2.84362
                  ÿÿÿÿÿ2#Control#1ÿÿ|ÿÿÿ548.6651ÿÿÿ18.44678ÿÿÿÿ29.74ÿÿÿ0.000ÿÿÿÿÿ512.5101ÿÿÿÿ584.8201
                  ÿÿÿÿÿ2#Control#2ÿÿ|ÿÿÿ544.8155ÿÿÿÿ18.8714ÿÿÿÿ28.87ÿÿÿ0.000ÿÿÿÿÿ507.8282ÿÿÿÿ581.8027
                  ÿÿÿÿÿ2#Control#3ÿÿ|ÿÿÿ529.2651ÿÿÿ18.44678ÿÿÿÿ28.69ÿÿÿ0.000ÿÿÿÿÿ493.1101ÿÿÿÿ565.4201
                  2#Experimental#1ÿÿ|ÿÿÿ555.6174ÿÿÿ12.92665ÿÿÿÿ42.98ÿÿÿ0.000ÿÿÿÿÿ530.2817ÿÿÿÿ580.9532
                  2#Experimental#2ÿÿ|ÿÿÿ507.7017ÿÿÿ13.98913ÿÿÿÿ36.29ÿÿÿ0.000ÿÿÿÿÿ480.2835ÿÿÿÿ535.1199
                  2#Experimental#3ÿÿ|ÿÿÿ522.5174ÿÿÿ12.92665ÿÿÿÿ40.42ÿÿÿ0.000ÿÿÿÿÿ497.1817ÿÿÿÿ547.8532
                  -----------------------------------------------------------------------------------

                  .ÿ*ÿControlÿtreatmentÿgroupÿchangeÿfromÿpretreatmentÿtoÿimmediateÿposttreatment
                  .ÿnlcomÿ(_b[1._predict#0.trt#2.tim]ÿ-ÿ_b[1._predict#0.trt#1.tim])ÿ/ÿ///
                  >ÿÿÿÿÿÿÿÿÿ(_b[2._predict#0.trt#2.tim]ÿ-ÿ_b[2._predict#0.trt#1.tim])

                  ÿÿÿÿÿÿÿ_nl_1:ÿ(_b[1._predict#0.trt#2.tim]ÿ-ÿ_b[1._predict#0.trt#1.tim])ÿ/ÿ(_b[2._predict#0.trt#2.tim]ÿ-ÿ_b[2._predict#0.trt#1.tim])

                  ------------------------------------------------------------------------------
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿCoefficientÿÿStd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
                  -------------+----------------------------------------------------------------
                  ÿÿÿÿÿÿÿ_nl_1ÿ|ÿÿÿ.0042419ÿÿÿ.0209603ÿÿÿÿÿ0.20ÿÿÿ0.840ÿÿÿÿ-.0368396ÿÿÿÿ.0453235
                  ------------------------------------------------------------------------------

                  .ÿ*ÿExperimentalÿtreatmentÿgroupÿchange
                  .ÿnlcomÿ(_b[1._predict#1.trt#2.tim]ÿ-ÿ_b[1._predict#1.trt#1.tim])ÿ/ÿ///
                  >ÿÿÿÿÿÿÿÿÿ(_b[2._predict#1.trt#2.tim]ÿ-ÿ_b[2._predict#1.trt#1.tim])

                  ÿÿÿÿÿÿÿ_nl_1:ÿ(_b[1._predict#1.trt#2.tim]ÿ-ÿ_b[1._predict#1.trt#1.tim])ÿ/ÿ(_b[2._predict#1.trt#2.tim]ÿ-ÿ_b[2._predict#1.trt#1.tim])

                  ------------------------------------------------------------------------------
                  ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿCoefficientÿÿStd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
                  -------------+----------------------------------------------------------------
                  ÿÿÿÿÿÿÿ_nl_1ÿ|ÿÿÿ.0024411ÿÿÿ.0009702ÿÿÿÿÿ2.52ÿÿÿ0.012ÿÿÿÿÿ.0005395ÿÿÿÿ.0043426
                  ------------------------------------------------------------------------------

                  .ÿ
                  .ÿexit

                  endÿofÿdo-file


                  .


                  Estimating association separately for the two groups is justified I suppose by the experimental design as well as by a test of the treatment × time interaction term, but keep in mind the maxim that the difference between a statistically significant result and a result that does not attain statistical significance is not necessarily itself statistically significant. You can see an example of that if you estimate the difference between the two ratios in a third -nlcom- command.

                  Comment


                  • #10
                    Originally posted by Joseph Coveney View Post
                    You can do something along the lines below, as one possible approach. (Begin at the "Begin here" comment; the stuff above is just exploration and shortening of the variable names for brevity in typing and display of regression output.).
                    Wow, this is super helpful, thank you so much for your time.

                    I have some follow up questions.

                    1) what is the lrest actually telling us here?
                    2) how can I estimate the difference between the two ratios with a third nlcom command?


                    Comment


                    • #11
                      also, would this be a hierarchical linear regression model ?

                      Comment


                      • #12
                        Originally posted by Lucy Hiscox View Post
                        I have some follow up questions.

                        1) what is the lrest actually telling us here?
                        The likelihood-ratio test is of the Treatment × Time interaction. It is statistical evidence (confirmation) that the temporal profile of the outcome variables differs between treatment groups (exercise treatment versus control treatment).

                        2) how can I estimate the difference between the two ratios with a third nlcom command?
                        I illustrate it below. It uses the -post- option of -nlcom- along with the command's syntax option of naming (labeling) the nonlinear combination (transformation), which together provide for a convenient shortcut to follow-on contrasts etc. (See the command's help file for details.) The illustration is for a different regression model. That needs some explanation, and so here it is.

                        The model that I used above for illustration didn't seem ideal, because it forces the covariance of the residuals for the two outcome variables (Flanker and MRI) to be constant across dramatically different conditions (see my comment about the covariance term in the output above) and because a simple random intercept doesn't really handle the longitudinal nature of the observations well. (Likelihood-ratio tests in both of your -xtmixed- MANOVA models strongly reject the notion that the unstructured covariance of the residuals may be safely ignored or simplified into compound-symmetry of a repeated-measures ANOVA.)

                        So the approach that I use below is a multivariate linear regression one in order to accommodate the varying covariance and the longitudinal nature of the study. Regardless: although the power is much improved by the (what I think is) better-fitting model, the conclusion is essentially the same. And the mechanics of the -nlcom- command are the same, too, if you want to continue using the previous model. (I happen to prefer the one below. I follow your original separate -xtmixed- MANOVA models in that the covariate adjustments for sex and age are held constant across the three sessions, which I think is reasonable.)

                        A minor point, but in the illustration of -nlcom- below, I inverted the ratio from that of the previous illustration above. It's in order to avoid tiny numbers and to more closely align with the graphs suggested earlier. It isn't intended to imply any causal relation.

                        Last, as an aside, although the maxim about the difference between a statistically significant difference and a not statistically difference not necessarily being statistically significant holds in this case, I think that the maxim is uninteresting in this case; not much of a heuristic here. The NHST of the difference of the two ratios is dominated by the imprecision of the estimate of the ratio in the control treatment group, and that is because nothing much is happening in that group (ratio of small over small).

                        Originally posted by Lucy Hiscox View Post
                        also, would this be a hierarchical linear regression model ?
                        Yes.

                        .ÿ
                        .ÿversionÿ17.0

                        .ÿ
                        .ÿclearÿ*

                        .ÿ
                        .ÿquietlyÿinputÿbyte(idÿgroupÿsex)ÿdoubleÿageÿbyteÿscanÿ///
                        >ÿÿÿÿÿÿÿÿÿdoubleÿwhole_brain_muÿintÿflanker_inc_rt

                        .ÿ
                        .ÿrenameÿidÿpid

                        .ÿrenameÿgroupÿtrt

                        .ÿrenameÿscanÿtim

                        .ÿrenameÿwhole_brain_muÿbmu

                        .ÿrenameÿflanker_inc_rtÿfrt

                        .ÿ
                        .ÿ*
                        .ÿ*ÿBeginÿhere
                        .ÿ*
                        .ÿquietlyÿreshapeÿwideÿbmuÿfrt,ÿi(pid)ÿj(tim)

                        .ÿ
                        .ÿassertÿinlist(sex,ÿ0,ÿ1)ÿ&ÿinlist(trt,ÿ0,ÿ1)

                        .ÿ
                        .ÿ//ÿMultivariateÿlinearÿregressionÿmodel
                        .ÿquietlyÿsemÿ///
                        >ÿÿÿÿÿÿÿÿÿ(bmu?ÿ<-ÿtrtÿsex@aÿage@b)ÿ///
                        >ÿÿÿÿÿÿÿÿÿ(frt?ÿ<-ÿtrtÿsex@cÿage@d),ÿ///
                        >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmethod(mlmv)ÿ///
                        >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿcovstructure(e._OEn,ÿunstructured)

                        .ÿsemÿÿ,ÿnocnsreportÿnofootnote

                        StructuralÿequationÿmodelÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿ=ÿ30
                        Estimationÿmethod:ÿmlmv

                        Logÿlikelihoodÿ=ÿ-427.27329

                        -----------------------------------------------------------------------------------
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿOIM
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿCoefficientÿÿstd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
                        ------------------+----------------------------------------------------------------
                        Structuralÿÿÿÿÿÿÿÿ|
                        ÿÿbmu1ÿÿÿÿÿÿÿÿÿÿÿÿ|
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿtrtÿ|ÿÿÿ.0844406ÿÿÿ.0472676ÿÿÿÿÿ1.79ÿÿÿ0.074ÿÿÿÿ-.0082021ÿÿÿÿ.1770834
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿsexÿ|ÿÿ-.0461388ÿÿÿ.0343458ÿÿÿÿ-1.34ÿÿÿ0.179ÿÿÿÿ-.1134553ÿÿÿÿ.0211777
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿageÿ|ÿÿÿ.0126745ÿÿÿ.0069064ÿÿÿÿÿ1.84ÿÿÿ0.066ÿÿÿÿ-.0008617ÿÿÿÿ.0262107
                        ÿÿÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ2.433085ÿÿÿ.1690419ÿÿÿÿ14.39ÿÿÿ0.000ÿÿÿÿÿ2.101769ÿÿÿÿ2.764401
                        ÿÿ----------------+----------------------------------------------------------------
                        ÿÿbmu2ÿÿÿÿÿÿÿÿÿÿÿÿ|
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿtrtÿ|ÿÿ-.0161944ÿÿÿ.0514428ÿÿÿÿ-0.31ÿÿÿ0.753ÿÿÿÿ-.1170203ÿÿÿÿ.0846316
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿsexÿ|ÿÿ-.0461388ÿÿÿ.0343458ÿÿÿÿ-1.34ÿÿÿ0.179ÿÿÿÿ-.1134553ÿÿÿÿ.0211777
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿageÿ|ÿÿÿ.0126745ÿÿÿ.0069064ÿÿÿÿÿ1.84ÿÿÿ0.066ÿÿÿÿ-.0008617ÿÿÿÿ.0262107
                        ÿÿÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ2.416755ÿÿÿ.1698527ÿÿÿÿ14.23ÿÿÿ0.000ÿÿÿÿÿÿ2.08385ÿÿÿÿÿ2.74966
                        ÿÿ----------------+----------------------------------------------------------------
                        ÿÿbmu3ÿÿÿÿÿÿÿÿÿÿÿÿ|
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿtrtÿ|ÿÿÿ.0973256ÿÿÿ.0379233ÿÿÿÿÿ2.57ÿÿÿ0.010ÿÿÿÿÿ.0229974ÿÿÿÿ.1716539
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿsexÿ|ÿÿ-.0461388ÿÿÿ.0343458ÿÿÿÿ-1.34ÿÿÿ0.179ÿÿÿÿ-.1134553ÿÿÿÿ.0211777
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿageÿ|ÿÿÿ.0126745ÿÿÿ.0069064ÿÿÿÿÿ1.84ÿÿÿ0.066ÿÿÿÿ-.0008617ÿÿÿÿ.0262107
                        ÿÿÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ2.432605ÿÿÿ.1674648ÿÿÿÿ14.53ÿÿÿ0.000ÿÿÿÿÿÿ2.10438ÿÿÿÿÿ2.76083
                        ÿÿ----------------+----------------------------------------------------------------
                        ÿÿfrt1ÿÿÿÿÿÿÿÿÿÿÿÿ|
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿtrtÿ|ÿÿÿ7.472171ÿÿÿ26.37792ÿÿÿÿÿ0.28ÿÿÿ0.777ÿÿÿÿÿ-44.2276ÿÿÿÿ59.17195
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿsexÿ|ÿÿÿ27.30773ÿÿÿ17.55604ÿÿÿÿÿ1.56ÿÿÿ0.120ÿÿÿÿ-7.101483ÿÿÿÿ61.71694
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿageÿ|ÿÿ-.8236882ÿÿÿÿ3.50548ÿÿÿÿ-0.23ÿÿÿ0.814ÿÿÿÿ-7.694302ÿÿÿÿ6.046926
                        ÿÿÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ553.4011ÿÿÿ86.33484ÿÿÿÿÿ6.41ÿÿÿ0.000ÿÿÿÿÿ384.1879ÿÿÿÿ722.6143
                        ÿÿ----------------+----------------------------------------------------------------
                        ÿÿfrt2ÿÿÿÿÿÿÿÿÿÿÿÿ|
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿtrtÿ|ÿÿ-37.55704ÿÿÿ22.23853ÿÿÿÿ-1.69ÿÿÿ0.091ÿÿÿÿ-81.14376ÿÿÿÿ6.029676
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿsexÿ|ÿÿÿ27.30773ÿÿÿ17.55604ÿÿÿÿÿ1.56ÿÿÿ0.120ÿÿÿÿ-7.101483ÿÿÿÿ61.71694
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿageÿ|ÿÿ-.8236882ÿÿÿÿ3.50548ÿÿÿÿ-0.23ÿÿÿ0.814ÿÿÿÿ-7.694302ÿÿÿÿ6.046926
                        ÿÿÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ550.0524ÿÿÿ85.54348ÿÿÿÿÿ6.43ÿÿÿ0.000ÿÿÿÿÿ382.3903ÿÿÿÿ717.7146
                        ÿÿ----------------+----------------------------------------------------------------
                        ÿÿfrt3ÿÿÿÿÿÿÿÿÿÿÿÿ|
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿtrtÿ|ÿÿ-6.227829ÿÿÿ19.09167ÿÿÿÿ-0.33ÿÿÿ0.744ÿÿÿÿ-43.64681ÿÿÿÿ31.19115
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿsexÿ|ÿÿÿ27.30773ÿÿÿ17.55604ÿÿÿÿÿ1.56ÿÿÿ0.120ÿÿÿÿ-7.101483ÿÿÿÿ61.71694
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿageÿ|ÿÿ-.8236882ÿÿÿÿ3.50548ÿÿÿÿ-0.23ÿÿÿ0.814ÿÿÿÿ-7.694302ÿÿÿÿ6.046926
                        ÿÿÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ534.0011ÿÿÿ85.04609ÿÿÿÿÿ6.28ÿÿÿ0.000ÿÿÿÿÿ367.3139ÿÿÿÿ700.6884
                        ------------------+----------------------------------------------------------------
                        ÿÿÿÿÿÿÿvar(e.bmu1)|ÿÿÿ.0142766ÿÿÿ.0037211ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0085658ÿÿÿÿ.0237949
                        ÿÿÿÿÿÿÿvar(e.bmu2)|ÿÿÿ.0170242ÿÿÿ.0045498ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0100827ÿÿÿÿ.0287445
                        ÿÿÿÿÿÿÿvar(e.bmu3)|ÿÿÿ.0089696ÿÿÿ.0023342ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0053859ÿÿÿÿ.0149378
                        ÿÿÿÿÿÿÿvar(e.frt1)|ÿÿÿ4480.171ÿÿÿÿ1157.52ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ2700.063ÿÿÿÿ7433.877
                        ÿÿÿÿÿÿÿvar(e.frt2)|ÿÿÿ2979.299ÿÿÿ799.1504ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ1761.135ÿÿÿÿ5040.059
                        ÿÿÿÿÿÿÿvar(e.frt3)|ÿÿÿ2271.484ÿÿÿ587.9054ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ1367.735ÿÿÿÿ3772.399
                        ------------------+----------------------------------------------------------------
                        cov(e.bmu1,e.bmu2)|ÿÿÿ.0110417ÿÿÿ.0035569ÿÿÿÿÿ3.10ÿÿÿ0.002ÿÿÿÿÿ.0040703ÿÿÿÿ.0180131
                        cov(e.bmu1,e.bmu3)|ÿÿÿ.0083508ÿÿÿ.0025821ÿÿÿÿÿ3.23ÿÿÿ0.001ÿÿÿÿÿ.0032901ÿÿÿÿ.0134116
                        cov(e.bmu1,e.frt1)|ÿÿÿ1.505973ÿÿÿ1.492099ÿÿÿÿÿ1.01ÿÿÿ0.313ÿÿÿÿ-1.418487ÿÿÿÿ4.430433
                        cov(e.bmu1,e.frt2)|ÿÿÿ.6821756ÿÿÿ1.329496ÿÿÿÿÿ0.51ÿÿÿ0.608ÿÿÿÿ-1.923588ÿÿÿÿ3.287939
                        cov(e.bmu1,e.frt3)|ÿÿÿ.4006166ÿÿÿ1.051054ÿÿÿÿÿ0.38ÿÿÿ0.703ÿÿÿÿ-1.659412ÿÿÿÿ2.460645
                        cov(e.bmu2,e.bmu3)|ÿÿÿ.0100428ÿÿÿ.0029957ÿÿÿÿÿ3.35ÿÿÿ0.001ÿÿÿÿÿ.0041713ÿÿÿÿ.0159143
                        cov(e.bmu2,e.frt1)|ÿÿÿ.7265535ÿÿÿÿ1.62819ÿÿÿÿÿ0.45ÿÿÿ0.655ÿÿÿÿÿ-2.46464ÿÿÿÿ3.917746
                        cov(e.bmu2,e.frt2)|ÿÿÿ.9292116ÿÿÿ1.546084ÿÿÿÿÿ0.60ÿÿÿ0.548ÿÿÿÿ-2.101058ÿÿÿÿ3.959481
                        cov(e.bmu2,e.frt3)|ÿÿÿÿ.821389ÿÿÿÿ1.18368ÿÿÿÿÿ0.69ÿÿÿ0.488ÿÿÿÿ-1.498581ÿÿÿÿ3.141359
                        cov(e.bmu3,e.frt1)|ÿÿÿ.8042795ÿÿÿ1.169762ÿÿÿÿÿ0.69ÿÿÿ0.492ÿÿÿÿ-1.488412ÿÿÿÿ3.096971
                        cov(e.bmu3,e.frt2)|ÿÿÿ.7060345ÿÿÿ1.041241ÿÿÿÿÿ0.68ÿÿÿ0.498ÿÿÿÿ-1.334761ÿÿÿÿÿ2.74683
                        cov(e.bmu3,e.frt3)|ÿÿÿ.0818863ÿÿÿ.8284215ÿÿÿÿÿ0.10ÿÿÿ0.921ÿÿÿÿÿ-1.54179ÿÿÿÿ1.705563
                        cov(e.frt1,e.frt2)|ÿÿÿ3116.897ÿÿÿ884.4868ÿÿÿÿÿ3.52ÿÿÿ0.000ÿÿÿÿÿ1383.334ÿÿÿÿ4850.459
                        cov(e.frt1,e.frt3)|ÿÿÿ2425.224ÿÿÿ731.6312ÿÿÿÿÿ3.31ÿÿÿ0.001ÿÿÿÿÿ991.2536ÿÿÿÿ3859.195
                        cov(e.frt2,e.frt3)|ÿÿÿÿ2123.33ÿÿÿÿ627.235ÿÿÿÿÿ3.39ÿÿÿ0.001ÿÿÿÿÿ893.9724ÿÿÿÿ3352.688
                        -----------------------------------------------------------------------------------

                        .ÿ
                        .ÿ//ÿTreatmentÿ×ÿtimeÿinteraction
                        .ÿtestÿ///
                        >ÿÿÿÿÿÿÿÿÿ(_b[bmu1:trt]ÿ=ÿ_b[bmu2:trt])ÿ///
                        >ÿÿÿÿÿÿÿÿÿ(_b[bmu1:trt]ÿ=ÿ_b[bmu3:trt])ÿ///
                        >ÿÿÿÿÿÿÿÿÿ(_b[frt1:trt]ÿ=ÿ_b[frt2:trt])ÿ///
                        >ÿÿÿÿÿÿÿÿÿ(_b[frt1:trt]ÿ=ÿ_b[frt3:trt])

                        ÿ(ÿ1)ÿÿ[bmu1]trtÿ-ÿ[bmu2]trtÿ=ÿ0
                        ÿ(ÿ2)ÿÿ[bmu1]trtÿ-ÿ[bmu3]trtÿ=ÿ0
                        ÿ(ÿ3)ÿÿ[frt1]trtÿ-ÿ[frt2]trtÿ=ÿ0
                        ÿ(ÿ4)ÿÿ[frt1]trtÿ-ÿ[frt3]trtÿ=ÿ0

                        ÿÿÿÿÿÿÿÿÿÿÿchi2(ÿÿ4)ÿ=ÿÿÿ28.42
                        ÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿÿÿÿ0.0000

                        .ÿ
                        .ÿ//ÿRatios
                        .ÿnlcomÿ///
                        >ÿÿÿÿÿÿÿÿÿ(ÿControl:ÿ(_b[frt2:_cons]ÿ-ÿ_b[frt1:_cons])ÿ/ÿ(_b[bmu2:_cons]ÿ-ÿ_b[bmu1:_cons])ÿ)ÿ///
                        >ÿÿÿÿÿÿÿÿÿ(ÿExperimental:ÿ(_b[frt2:_cons]ÿ+ÿ_b[frt2:trt]ÿ-ÿ_b[frt1:_cons]ÿ-ÿ_b[frt1:trt])ÿ/ÿ///
                        >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(_b[bmu2:_cons]ÿ+ÿ_b[bmu2:trt]ÿ-ÿ_b[bmu1:_cons]ÿ-ÿ_b[bmu1:trt])ÿ),ÿnoheaderÿpost

                        ------------------------------------------------------------------------------
                        ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿCoefficientÿÿStd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
                        -------------+----------------------------------------------------------------
                        ÿÿÿÿÿControlÿ|ÿÿÿÿ205.064ÿÿÿ696.3927ÿÿÿÿÿ0.29ÿÿÿ0.768ÿÿÿÿ-1159.841ÿÿÿÿ1569.969
                        Experimentalÿ|ÿÿÿ413.6101ÿÿÿ91.96655ÿÿÿÿÿ4.50ÿÿÿ0.000ÿÿÿÿÿÿ233.359ÿÿÿÿ593.8613
                        ------------------------------------------------------------------------------

                        .ÿ
                        .ÿ//ÿDifferenceÿbetweenÿratios
                        .ÿtestÿControlÿ=ÿExperimental

                        ÿ(ÿ1)ÿÿControlÿ-ÿExperimentalÿ=ÿ0

                        ÿÿÿÿÿÿÿÿÿÿÿchi2(ÿÿ1)ÿ=ÿÿÿÿ0.09
                        ÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿÿÿÿ0.7660

                        .ÿtestnlÿ_b[Control]ÿ/ÿ_b[Experimental]ÿ=ÿ1

                        ÿÿ(1)ÿÿ_b[Control]ÿ/ÿ_b[Experimental]ÿ=ÿ1

                        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿchi2(1)ÿ=ÿÿÿÿÿÿÿÿ0.09
                        ÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿÿÿÿÿÿÿÿ0.7648

                        .ÿ
                        .ÿ*
                        .ÿ*ÿCloudÿformations
                        .ÿ*
                        .ÿgraphÿdropÿ_all

                        .ÿquietlyÿregressÿageÿpid

                        .ÿtempnameÿp

                        .ÿscalarÿdefineÿ`p'ÿ=ÿr(table)["pvalue",ÿ"pid"]

                        .ÿlocalÿPÿ:ÿdisplayÿ%05.3fÿ`p'

                        .ÿgraphÿtwowayÿ///
                        >ÿÿÿÿÿÿÿÿÿlineÿageÿpid,ÿlcolor(black)ÿ||ÿ///
                        >ÿÿÿÿÿÿÿÿÿlfitÿageÿpid,ÿlcolor(black)ÿlpattern(dash)ÿ///
                        >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿylabel(ÿ,ÿangle(horizontal)ÿnogrid)ÿytitle(Age)ÿ///
                        >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿxtitle(ParticipantÿAccessionÿNumber)ÿlegend(off)ÿ///
                        >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿtext(27.5ÿ10ÿ"Pÿ=ÿ`P'")ÿname(A)

                        .ÿ
                        .ÿquietlyÿregressÿfrt1ÿpid

                        .ÿscalarÿdefineÿ`p'ÿ=ÿr(table)["pvalue",ÿ"pid"]

                        .ÿlocalÿPÿ:ÿdisplayÿ%05.3fÿ`p'

                        .ÿgraphÿtwowayÿ///
                        >ÿÿÿÿÿÿÿÿÿlineÿfrt1ÿpid,ÿlcolor(black)ÿ||ÿ///
                        >ÿÿÿÿÿÿÿÿÿlfitÿfrt1ÿpid,ÿlcolor(black)ÿlpattern(dash)ÿ///
                        >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿylabel(ÿ,ÿangle(horizontal)ÿnogrid)ÿytitle(BaselineÿFlankerÿRT)ÿ///
                        >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿxtitle(ParticipantÿAccessionÿNumber)ÿlegend(off)ÿ///
                        >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿtext(700ÿ20ÿ"Pÿ=ÿ`P'")ÿname(B)

                        .ÿ
                        .ÿgraphÿcombineÿAÿB

                        .ÿquietlyÿgraphÿexportÿ"CloudÿFormations.png"

                        .ÿ
                        .ÿexit

                        endÿofÿdo-file


                        .


                        The clustering of the missing second-session cognitive test values early in enrollment (assuming that "id" represents participant accession sequence) and the general decline in Flanker Incongruous RT over the three sessions (so-called learning phenomenon, I suppose) seemed curious. The phenomena inspired more exploration.

                        Click image for larger version

Name:	Cloud Formations.png
Views:	1
Size:	57.2 KB
ID:	1653982

                        Comment


                        • #13
                          Hi Joseph,

                          This all sounds great - thanks once again.

                          There are a few more things to run by you.

                          So here is my dataset again. Like I said before, I have 5 measures of Cognition (sr, flanker_inc_rt, flanker_c_rt, stroop_inc_rt, stroop_c_rt) - so I would rather use all 5 and combine as an overall latent variable.

                          Code:
                          * Example generated by -dataex-. For more info, type help dataex
                          clear
                          input byte(pid trt sex) double age byte tim double(bmu sr) int(flanker_c_rt flanker_inc_rt stroop_c_rt stroop_inc_rt)
                           1 1 1 19.65 1  2.779  -1.10176907 554 611 775 794
                           1 1 1 19.65 2 2.8865 -1.078266652   .   .   .   .
                           1 1 1 19.65 3  2.938   -.99567432 506 552 707 721
                           2 1 0 19.79 1 2.8303   .444069947 450 515 810 894
                           2 1 0 19.79 2  2.706   .183567766   .   .   .   .
                           2 1 0 19.79 3 2.8309  -.197848812 534 534 754 870
                           3 1 0 22.47 1 2.8026  -.540781841 473 509 640 721
                           3 1 0 22.47 2 2.6632 -1.086365293   .   .   .   .
                           3 1 0 22.47 3 2.8266 -1.099852349 460 459 636 640
                           4 1 1 20.53 1 3.0665  -.439480866 575 597 811 877
                           4 1 1 20.53 2 2.9192  -.561148979   .   .   .   .
                           4 1 1 20.53 3 2.8305  -.455851049 554 560 691 749
                           5 0 1 20.54 1 2.8067  -.666158082 562 577 613 650
                           5 0 1 20.54 2 2.9067  -.606886805   .   .   .   .
                           5 0 1 20.54 3 2.7982  -.843198022 551 597 592 621
                           6 1 1 24.39 1 2.7701  -.680082582 608 649 518 526
                           6 1 1 24.39 2 2.5172  -.573372234   .   .   .   .
                           6 1 1 24.39 3 2.7511 -1.060744124 466 542 640 650
                           7 1 1 22.34 1 2.6797   .741991873 575 586 701 799
                           7 1 1 22.34 2 2.5227  -.291406505   .   .   .   .
                           7 1 1 22.34 3   2.71  -.614520865 498 576 694 821
                           8 1 0  19.1 1  2.847  1.446398889 516 525 588 624
                           8 1 0  19.1 2 2.7707   .384614966 468 482 569 679
                           8 1 0  19.1 3 2.8263  -.714438215 487 521 594 642
                           9 1 0 19.63 1 2.7862  -.152752072 518 561 593 599
                           9 1 0 19.63 2 2.7173  -.708459883 505 519 528 569
                           9 1 0 19.63 3 2.8551  -.464140768 517 525 533 570
                          10 1 1 23.38 1 2.6764    .09811649 675 635 774 778
                          10 1 1 23.38 2   2.51  -.546545096   .   .   .   .
                          10 1 1 23.38 3 2.6415    -.6109709 571 612 719 722
                          11 1 1  24.8 1 2.8238  1.243167351 799 808 762 745
                          11 1 1  24.8 2 2.6421   .856045186 658 669 675 672
                          11 1 1  24.8 3 2.8527   .653275217 631 652 690 712
                          12 1 1 24.27 1 2.7843  -.154474981 511 502 669 697
                          12 1 1 24.27 2  2.678  -.086300902 431 490 560 619
                          12 1 1 24.27 3 2.7973  -.243370204 456 478 610 563
                          13 0 1 21.33 1 2.7188   .314676169 501 526 774 942
                          13 0 1 21.33 2 2.6568            . 469 495 870 853
                          13 0 1 21.33 3 2.7556   .002169961 472 506 803 861
                          14 1 1 21.18 1 2.6368  -.012371745 417 454 594 676
                          14 1 1 21.18 2 2.5191  -.624675031 435 484 543 596
                          14 1 1 21.18 3 2.6911  -.606797151 439 468 556 591
                          15 0 1 21.96 1  2.515   .938966163 554 534 639 695
                          15 0 1 21.96 2 2.5181   .570395218 460 477 657 630
                          15 0 1 21.96 3 2.5438  1.021777094 469 459 612 634
                          16 1 1 21.84 1  2.708 -1.017252285 525 530 753 824
                          16 1 1 21.84 2 2.5153  -.884789954 494 517 556 607
                          16 1 1 21.84 3 2.7338  -.908653764 485 505 541 602
                          17 1 0 23.21 1 2.8715  -.354341177 448 487 629 651
                          17 1 0 23.21 2 2.6165  -.634360489 427 424 588 586
                          17 1 0 23.21 3 2.8309   -.55649457 465 463 474 537
                          18 1 0 26.42 1 2.7411 -1.163105718 490 552 623 690
                          18 1 0 26.42 2 2.6225 -1.160135709 455 491 542 629
                          18 1 0 26.42 3 2.8017  -1.16849681 429 480 556 643
                          19 0 0  23.3 1 2.9521  2.526123686 577 593 812 773
                          19 0 0  23.3 2 2.7254  3.367891791 567 585 773 866
                          19 0 0  23.3 3 2.8178  2.848910151 516 514 690 786
                          20 0 0 20.99 1 2.5776  -.328822314 647 640 890 907
                          20 0 0 20.99 2 2.6514  -.229926801 571 676 928 977
                          20 0 0 20.99 3 2.6365   -.60991744 581 621 859 957
                          21 0 0 27.13 1 2.6038   .226747357 497 514 619 649
                          21 0 0 27.13 2 2.6092  -.584941102 539 506 569 659
                          21 0 0 27.13 3 2.6431   .050546042 518 557 567 644
                          22 1 0 19.42 1 2.6777  2.760956126 545 540 714 793
                          22 1 0 19.42 2 2.4152  1.515645912 423 464 593 721
                          22 1 0 19.42 3 2.5506  1.391587845 487 515 660 716
                          23 0 1 21.33 1 2.4942  2.058411643 512 537 739 764
                          23 0 1 21.33 2 2.5842  1.413412403 520 559 627 708
                          23 0 1 21.33 3 2.5922  1.536878071 484 546 692 698
                          24 1 0 20.15 1  2.723   .377720199 591 593 778 840
                          24 1 0 20.15 2 2.7915   .502453736 487 517 609 683
                          24 1 0 20.15 3 2.7408   .149498809 483 522 638 618
                          25 0 0 30.36 1 2.9172            . 511 534 679 744
                          25 0 0 30.36 2 2.8434   .078455141 503 536 604 667
                          25 0 0 30.36 3  2.871   .158524554 526 510 616 710
                          26 1 0 26.49 1 2.9862  -.474674945 501 523 527 546
                          26 1 0 26.49 2 2.8391  -.747579559 466 454 506 522
                          26 1 0 26.49 3 2.9984  -.893166377 469 508 462 509
                          27 1 1 22.32 1 2.6267  1.062625501 478 508 628 682
                          27 1 1 22.32 2 2.6333   .926799205 494 484 637 596
                          27 1 1 22.32 3 2.8271   .294632184 472 483 585 593
                          28 1 1 25.21 1 2.6864   .132276627 479 465 692 776
                          28 1 1 25.21 2 2.6786   .202811988 420 463 566 627
                          28 1 1 25.21 3  2.717  -.151522037 458 533 599 678
                          29 0 0 23.04 1 2.6642  -.089673302 469 480 575 582
                          29 0 0 23.04 2 2.6514  -.838334929 450 493 488 524
                          29 0 0 23.04 3 2.6606  -.898042399 469 489 505 529
                          30 0 0 25.84 1 2.8856  -.018840355 460 514 547 691
                          30 0 0 25.84 2 2.8253  -.758178734 462 494 530 528
                          30 0 0 25.84 3 2.8116   -.19218509 419 456 515 578
                          end
                          label values trt Treatments
                          label def Treatments 0 "Control", modify
                          label def Treatments 1 "Experimental", modify
                          label values sex labels1
                          label def labels1 0 "Male", modify
                          label def labels1 1 "Female", modify

                          Therefore, I do the following:

                          PHP Code:
                          gsem (Cognition -> flanker_c_rt ) (Cognition -> flanker_inc_rt, ) (Cognition -> stroop_c_rt, ) (Cognition -> stroop_inc_rt, )  (Cognition -> sr, ), latent(Cognition startvalues(ivstartgrid

                           
                          foreach v in Cognition {
                              
                          predict `v', latent(`v')
                              egen std_`v'
                          std(`v') 
                              } 

                          PHP Code:
                          rename std_Cognition cog

                          drop flanker_c_rt flanker_inc_rt flanker_effect_rt stroop_c_rt stroop_inc_rt stroop_effect_rt sr Cognition 
                          Then I go onto your code:

                          PHP Code:
                          quietly reshape wide bmu cogi(pidj(tim)

                          assert inlist(sex01) & inlist(trt01)

                          quietly sem ///
                              
                          (bmu? <- trt sex@a age@b///
                              
                          (cog? <- trt sex@c age@d), ///
                              
                          method(mlmv///
                              
                          covstructure(e._OEnunstructured)

                          sem nocnsreport nofootnote 
                          PHP Code:
                          //Treatment x time interaction

                          test ///
                              
                          (_b[bmu1:trt] = _b[bmu2:trt]) ///
                              
                          (_b[bmu1:trt] = _b[bmu3:trt]) ///
                              
                          (_b[cog1:trt] = _b[cog2:trt]) ///
                              
                          (_b[cog1:trt] = _b[cog3:trt]) 
                          which works fine - until:

                          PHP Code:
                          // Ratios
                          nlcom ///
                          Control: (_b[cog2:_cons] - _b[cog1:_cons]) / (_b[bmu2:_cons] - _b[bmu1:_cons]) ) ///
                          Experimental: (_b[cog2:_cons] + _b[cog2:trt] - _b[cog1:_cons] - _b[cog1:trt]) ) ///
                                  
                          (_b[bmu2:_cons] + _b[bmu2:trt] - _b[bmu1:_cons] - _b[bmu1:trt]) ), noheader post 
                          as I keep getting an error saying "unknown function Control)". Can't see what is wrong there.

                          Other than that:
                          • The Treatment x Time interaction. I am not sure how this differs from my first two aims. In the paper I still plan to include:
                          AIM 1: xtmixed bmu trt##tim i.sex c.age || pid:, var noconst residuals(unstr, t(tim)) reml
                          contrast trt##tim
                          This provides a significant interaction between group and time, as expected: F2,39.22 = 13.31, p = .0010

                          AIM 2: Then wanted to see whether there was an interaction between group and time on cognitive performance:
                          xtmixed cog trt##tim i.sex c.age || pid:, var noconst residuals(unstr, t(tim)) reml
                          contrast trt##tim

                          which was: F2,35.30 = 11.00, p = .0041

                          AIM 3: How changes in mu influences changes in cognition - that differ by group. I am a bit confused as you mentioned before how "The likelihood-ratio test is of the Treatment × Time interaction. It is statistical evidence (confirmation) that the temporal profile of the outcome variables differs between treatment groups (exercise treatment versus control treatment)." Which is what we get from AIMS 1 and 2. Is that correct?
                          • As for the clustering of the missing second session test values early in enrollment - this was just because it hadn't yet been decided to add in these extra tests. Hence, why I am trying to push for a more composite measure of all 5.
                          • The first graph you provided - it is completely random how participants recruited later are slightly older.
                          • Also, the second graph you provided (participant accession number vs Flanker RT). I can't see how that would be a learning effect given how each participant is independent.
                          Thanks very much

                          Comment


                          • #14
                            As for the error - i accidentally put a ) when it was meant to be a /

                            so this works fine now:

                            PHP Code:
                            // Ratios
                             
                            nlcom ///
                                      
                            Control: (_b[cog2:_cons] - _b[cog1:_cons]) / (_b[bmu2:_cons] - _b[bmu1:_cons]) ) ///
                                      
                            Experimental: (_b[cog2:_cons] + _b[cog2:trt] - _b[cog1:_cons] - _b[cog1:trt]) / ///
                                    
                            (_b[bmu2:_cons] + _b[bmu2:trt] - _b[bmu1:_cons] - _b[bmu1:trt]) ), noheader post 
                            But generally a bit unsure about the latent variable and how to write it up now.

                            1) It is a multivariate linear regression - DVs being MRI variables and Cognition (by the way, I have 14 brain MR measures in total, and so will be running this model separately for each of them).
                            2) one that accommodates the varying covariance and the longitudinal nature of the study (is there a specific name)?
                            3) LR test - I think that is essentially the same as the mixed command?
                            4) While we have the ratios for experimental and controls - is there also a way to say "changes in MRI correspond with changes in Cognition" overall in both groups - as an overall summary. FYI - yes the literature suggests that this very specific MRI measure would act in this time frame.

                            All the best
                            Lucy
                            Last edited by Lucy Hiscox; 14 Mar 2022, 07:42.

                            Comment


                            • #15
                              Originally posted by Joseph Coveney View Post

                              So the approach that I use below is a multivariate linear regression one in order to accommodate the varying covariance and the longitudinal nature of the study. Regardless: although the power is much improved by the (what I think is) better-fitting model, the conclusion is essentially the same. And the mechanics of the -nlcom- command are the same, too, if you want to continue using the previous model. (I happen to prefer the one below. I follow your original separate -xtmixed- MANOVA models in that the covariate adjustments for sex and age are held constant across the three sessions, which I think is reasonable.)

                              A minor point, but in the illustration of -nlcom- below, I inverted the ratio from that of the previous illustration above. It's in order to avoid tiny numbers and to more closely align with the graphs suggested earlier. It isn't intended to imply any causal relation.

                              [ATTACH=CONFIG]n1653982[/ATTACH]
                              Hi Joseph - just checking whether you saw my reply? cheers

                              Comment

                              Working...
                              X