Hi all,
I have a question about attempting to model a mixed, random intercept/slope repeated measures regression analysis as a spline model, setting distinct knot points at each time period.
The goal of my analysis is to obtain a graphic that depicts a continuous variable on the Y-axis as a score measurement, a categorical time-session measure (equally spaced 2-10, 12) on the X-axis, and have a set of curves representing 702 individual slopes and intercepts (the subjects in our analysis). Ideally, we'd like to have knot points at each individual session, with the slopes of the curves in-between.
I'm not really sure how to go about obtaining/creating a graph as such. I started by performing a random intercept/slope PROC MIXED regression analysis, using the following code:
ods graphics on;
proc mixed data=Data plots = all order=freq;
model sessionScore = sessionContinuous / solution;
random intercept sessionContinuous / subject = id solution;
run;
ods graphics off;
This gave me the random intercept and slopes for each individual. I'm assuming I could use these values to create the content in the graph I hypothesized earlier, but am not sure how to do so or where I would start.
Can the random intercept/slopes obtained be used in a graph like this, or would another analysis need to be performed entirely?
Thanks in advance for any help or guidance!
Your current model assumes a linear relationship between sessionScore and sessionContinuous, rather than some sort of smoothed curve.
For an example of smoothed curves fit to individual subjects, you might find this GLIMMIX example useful: Example 47.6 Radial Smoothing of Repeated Measures Data. Documentation about the radial smoother is here: Radial Smoothing Based on Mixed Models.
Splines are available using the EFFECT statement in GLIMMIX: see Rick Wicklin's blog Regression with restricted cubic splines in SAS and the links within, as well as the GLIMMIX documentation.
I would not expect a graphic with 702 separate curves to be visually useful (too much overplotting, I would think), but you could plot a small sample of the 702.
I hope this helps.
Your current model assumes a linear relationship between sessionScore and sessionContinuous, rather than some sort of smoothed curve.
For an example of smoothed curves fit to individual subjects, you might find this GLIMMIX example useful: Example 47.6 Radial Smoothing of Repeated Measures Data. Documentation about the radial smoother is here: Radial Smoothing Based on Mixed Models.
Splines are available using the EFFECT statement in GLIMMIX: see Rick Wicklin's blog Regression with restricted cubic splines in SAS and the links within, as well as the GLIMMIX documentation.
I would not expect a graphic with 702 separate curves to be visually useful (too much overplotting, I would think), but you could plot a small sample of the 702.
I hope this helps.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.