BookmarkSubscribeRSS Feed
kleger
Calcite | Level 5

Hello,

 

I am trying to model blood pressure growth trajectories  across two distinct periods (reactivity and recovery from a stressor). I am looking to examine rates of linear growth for levels of bp for each person within each period. I also include person-level predictors.

 

I am currently modeling blood pressure as a function of each time point. However, there are 8 time points (4 during the reactivity phase and 4 during the recovery phase), and I would like to divide time into two periods, before minute 4 and after minute 4.

Here is my SAS code modeling each time point (I use SAS 9.4):

proc mixed data=third;
class condition time;
model systolic =  time|condition;
repeated time / sub=id type=un;
lsmeans time|condition;
run; 

How can I create a spline model where I can get two separate coefficients (one before time=4 and one after time=4)?

 

 

Thank you!

3 REPLIES 3
WarrenKuhfeld
Ammonite | Level 13

Change my time of 12 to your time of 4.

data x;
   set sashelp.class(rename=(age=time));
   time1 = (time <= 12) * time;
   time2 = (time >  12) * time;
   run;

 

Rick_SAS
SAS Super FREQ

You mentioned splines, but your code does not appear to use splines. When you use the EFFECT statement to construct the spline, put a knot at time=4. That will enable you to create a piecewise linear model. See the second example in the article "Nonsmooth models and spline effects."

kleger
Calcite | Level 5

Thank you, Rick! This was very helpful.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is ANOVA?

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.

Discussion stats
  • 3 replies
  • 3080 views
  • 1 like
  • 3 in conversation