# SEM/regression: Identify better predictor

I have data from a longitudinal study, specifically MRI data and performance on a neuropsychological test at two time points. I would like to test whether the change in gray matter in Brain Region A is a better predictor of the change in my neuropsychological measure than the change in gray matter in Brain Region B. Would it be possible to analyze this with a regression or a structural equation model?

This would only really require a dummy-coded categorical regression, using Region A as the reference group and Region B as the comparison group. I'm assuming that because you are doing a longitudinal study that you expect some change over time as well. Below I simulate some data in R and fit a regression which tests the following elements:

• Does the dependent variable vary by brain region?
• Does the dependent variable vary by year?
• Is there an interaction between the two? In other words, do both regions of the brain exhibit the same differences with each year?

The code below simulates what this could look like:

#### Simulate And Plot Data ####
library(tidyverse)
set.seed(123)
region <- rbinom(100,1,.5)
time <- rbinom(100,1,.5)
y <- (20*region) + (.8 * time) + (40*region*time) + rnorm(100)
df <- data.frame(region,
time,
f.region = factor(region,labels = c("Region A","Region B")),
f.time = factor(time,labels=c("Year 1", "Year 2")),
y)

#### Fit and Summarize Model ####
fit <- lm(y ~ f.time * f.region, df)
summary(fit)

#### Plot ####
df %>%
ggplot(aes(x=region,
y=y))+
geom_jitter(
width=.1,
height=.1
)+
geom_smooth(method = "lm",
color='red')+
facet_wrap(~f.time,
nrow = 1)+
labs(x='Brain Region',
y="Dependent Variable",
title="Longitudinal Change in Y by Brain Region")+
theme_bw()


We can see from the plot here that shows that region and time play a role in the dependent variable. Region B is generally higher in the dependent variable, but this is magnified by Year 2 (the points here are jittered but otherwise only take on one value for each group, hence the dummy coding).

Running summary(fit) to get the regression output confirms this. We see that Region B has a 20 point increase in mean $$y$$ scores, and there is about a 40 point jump when recorded at Year 2 compared to Region A:

Call:
lm(formula = y ~ f.time * f.region, data = df)

Residuals:
Min       1Q   Median       3Q      Max
-2.51617 -0.57451  0.08391  0.66498  2.33184

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)                    0.09838    0.17253   0.570    0.570
f.timeYear 2                   0.40801    0.25639   1.591    0.115
f.regionRegion B              19.71488    0.24848  79.342   <2e-16 ***
f.timeYear 2:f.regionRegion B 40.82899    0.37533 108.780   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.9291 on 96 degrees of freedom
Multiple R-squared:  0.9985,    Adjusted R-squared:  0.9984
F-statistic: 2.077e+04 on 3 and 96 DF,  p-value: < 2.2e-16


#### Edit

Per the comments, I moved some of my discussion into this answer so as not to crowd the comments section. Using a SEM depends entirely on the complexity of your problem, but what you proposed here seems to make it unnecessary. The only thing a SEM would accomplish here is fitting the exact same regression into SEM software. It would be pointless unless you had something like latent variables or multiple dependent variables. As for learning about SEM, I recommend this book as well as this book. Since you mentioned being new to SEM, I will also recommend that you have a strong understanding of regression and measurement theory before using SEMs. They are not models that people should take lightly and are prone to misuse even by experienced practitioners.