Question about modeling in longitudinal analysis

158 views
Skip to first unread message

Nathan Petro

unread,
May 18, 2023, 2:44:42 PM5/18/23
to SwE-Toolbox Support

We are investigating the effect of age across 3 visits on MEG brain activity. We are wanting to know the best way to model this effect using the SwE toolbox. We input all brain data (across all participants and 3 visits) in the “scans” box, and indicated each scan as 1, 2, or 3 in the “visits” box. To control for sex, we entered a vector of 1 or 2 to indicate whether each brain data file belonged to a female or male participant. We also input a vector of numbers to indicate each subject – the numbers matched across all 3 visits. Note that not all subjects possess data for all 3 time points.  

We then input covariates for 1) the intercept (a vector of 1s), 2) Visit (a vector of 1, 2, or 3), 3) age (the age of each participant at each scan), and 4) the visit*age interaction term.  

In the covariates section, is it necessary to model “visit” even though we indicate as much in the “visits” input box? 

Would the visit*age interaction term represent the (modeled as: 0 0 0 1) reflect the effect of age across all 3 visits? 

Thomas Nichols

unread,
May 20, 2023, 7:52:59 AM5/20/23
to swe-t...@googlegroups.com
Dear Nathan,

We are investigating the effect of age across 3 visits on MEG brain activity. We are wanting to know the best way to model this effect using the SwE toolbox. We input all brain data (across all participants and 3 visits) in the “scans” box, and indicated each scan as 1, 2, or 3 in the “visits” box.

Good.

To control for sex, we entered a vector of 1 or 2 to indicate whether each brain data file belonged to a female or male participant.

Fine; we often use 0/1 coding so the overall mean has the interpretation of one of the groups, or even better -1/2 1/2 so that the mean has the interpretation as being half-way between the two groups.  But the statistical inferences will be the same regardless of the choice. 

We also input a vector of numbers to indicate each subject – the numbers matched across all 3 visits. Note that not all subjects possess data for all 3 time points.  

Just to be very clear, this is *not* to be entered as a covariate or part of the design matrix.  This is just to be entered into the 'Subjects' box. 

We then input covariates for 1) the intercept (a vector of 1s), 2) Visit (a vector of 1, 2, or 3), 3) age (the age of each participant at each scan), and 4) the visit*age interaction term.  

This is fine, and represents a linear effect of visit, linear effect of age, and an age-dependent visit effect.  

In the covariates section, is it necessary to model “visit” even though we indicate as much in the “visits” input box? 

Yes... in the spirit of SPM, you must model everything yourself :) 

Would the visit*age interaction term represent the (modeled as: 0 0 0 1) reflect the effect of age across all 3 visits?

No, it is only the extent to which the visit effect is age-dependent (or, equivalently, that the age effect is visit dependent).

You haven't mentioned the spacing between the visits, whether it is substantial (e.g. years) and whether it varies between subjects.  

Let me sketch out two alternate approaches to this sort of data.

I. Short-duration interventional study, repeated measures model

You image the subjects over a short duration and with consistent intervals (e.g. 1 week inter-visit intervals, same for all subjects), and are manipulating the subjects in some way (let's call it a practice effect to be concrete).  You are interested in the practice effect, age effect and the interaction.  You can use the model

S1V1  1 -1  32 -32
S1V2  1  0  32   0
S2V3  1  1  32  32
S1V1  1 -1  24 -24
...

Where coefficients are: Intercept; linear practice effect; age effect; age*linear practice effect. It is also common to center age first, but this will have no impact except to ensure the intercept is interpretable.

You might rather be interested in distinct patterns of the visits, e.g. 1 vs 2, 2 vs 3, etc, and in that case you would use the model 

S1V1  1  0  0  32   0   0
S1V2  0  1  0   0  32   0
S2V3  0  0  1   0   0  32
S1V1  1  0  0  24   0   0
...

 where the first 3 columns now code the mean for visit 1, 2 and 3, respectively, and the remaining 3 code the visit-specific effect of age. You can interrogate these effects pairwise e.g. contrasts like [-1 1 0...] or with F contrasts.  Note, if you have a painfully low sample size the former (linear) model might be better, but also consider that you can have a different model for the interaction than the main effect, e.g.


II. Long-duration interventional/observational study, repeated measures model

You image over a period of months or years, and the intervals are not necessarily consistent (e.g. some are scanned 0m, +6m, +12m, other 0m, +9m,+24m, etc), and you want to model time and age effects.  The very simplest form the model could take is

S1V1  1  32.00
S1V2  1  32.50
S2V3  1  33.00 
S1V1  1  24.00
S1V2  1  24.75
...

where you just model the effect of age. However, as discussed in the SwE paper (Guillaume et al, 2014) and expanded on in Sørensen et al. (2021), you probably want to dissociate the longitudinal effects of time from the crosssectional effects of age. One way of doing this modelling time from baseline and baseline age as two separate effects:

S1V1  1  0.00 32   0
S1V2  1  0.50 32  16
S2V3  1  1.00 32  32
S1V1  1  0.00 24   0
S1V2  1  0.75 24  18
...

... where first column is the intercept, 2nd column is longitudinal effect of time, 3rd column is the crossectional effect of age at baseline, and the 4th column is the interaction, the age-dependent effect of study time, which can express 'acceleration' or 'deceleration' or cohort effects.

Does this help?

-Tom

Guillaume, B., Hua, X., Thompson, P. M., Waldorp, L., Nichols, T. E., & Alzheimer’s Disease Neuroimaging Initiative. (2014). Fast and accurate modelling of longitudinal and repeated measures neuroimaging data. NeuroImage, 94, 287–302. https://doi.org/10.1016/j.neuroimage.2014.03.029

Sørensen, Ø., Walhovd, K. B., & Fjell, A. M. (2021). A recipe for accurate estimation of lifespan brain trajectories, distinguishing longitudinal and cohort effects. NeuroImage, 226, 117596. https://doi.org/10.1016/j.neuroimage.2020.117596


 

--
You received this message because you are subscribed to the Google Groups "SwE-Toolbox Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swe-toolbox...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swe-toolbox/83a9fc0e-dd47-47d1-8700-dd74659655c4n%40googlegroups.com.

Nathan Petro

unread,
Feb 3, 2025, 3:45:51 PMFeb 3
to SwE-Toolbox Support
Tom,

Thank you so much for the response, and our apologies for the rather delayed response. This is very very helpful!

We wanted to confirm something. In the Guillaume 2014 paper, the analyses indicate that SwE can account for changes in longitudinal slopes as a function of different baseline ages (i.e., the interaction between longitudinal and baseline ages). Is this equivalent (or similar) to using random slopes in a LME model (one that includes an interaction between longitudinal and baseline age)? Or, is it perhaps slightly different?

Thank you for your continued efforts with supporting this toolbox. 



best,
Nate

Reply all
Reply to author
Forward
0 new messages