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
    Last edited by Lucy Hiscox; 08 Mar 2022, 04:39.

  • #2
    Data below:
    Last edited by Lucy Hiscox; 08 Mar 2022, 04:38.

    Comment


    • #3
      PHP Code:
      input byte(id group sexdouble 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

      Comment

      Working...
      X