BookmarkSubscribeRSS Feed
Kunko
Obsidian | Level 7

Hi every one;

I am using proc genmod to calculate the mean change in blood pressure from baseline to the first follow-up in association with tertiles of Health Eating Index score. I am using the following code for this purpose:

proc genmod data=BP_long order=internal;
class HEI_Tertile time var1 var1 var3/ref=first;
model ChangeBP=time HEI_Tertile var1 var1 var3 var4 var5 /type3 lrci;
repeated subject=codea/type=exch corrw;
run;

However, I am having unexpected results for the mean changes, where high consumers of healthy diet in the top tertile had more increased BP. I am not sure whether this is related to the coding here or transposing of the data to a long foramt. I used the following for transposing and then renamed;

 

proc sort; by Id; run;
proc transpose data=BP_wide out=BP_long;
var BP1-BP2;
by id;
run; 


*Renaming the transposed variable;
data BP_long;
set BP_long (rename=(col1=ChangeBP));
If _Name_ = 'BP1' then Time= 1;
Else if _Name_= 'BP2' then Time=2;
Drop _Name_ _label_;
run;

 

Thank you so much in advance.

 

2 REPLIES 2
SteveDenham
Jade | Level 19

@StatDave could give you a more definitive answer, but here is what I am thinking: First off, I see var1 repeated in both the class and model statements. I am guessing this is a typo, and the second instance should be var2. Next, you have two continuous covariates - is there any possibility that these are partially confounded with the levels of time or of the tertiles for HEI? That could lead to a Simpson's paradox situation. Additionally, you might have an issue with your Change variable - it is only defined at time=2, so there really isn't a reason to include time in the model. My final comment would be about changing from wide to long. I often have trouble using PROC TRANSPOSE to do wide to long, and so have usually resorted to a DATA step approach. In this case though, I don't see a need to change to long format, as you are not modeling raw BP values over time, but rather ChangeBP with the various covariates listed. If the independent variables have different values over time, I have a different concern - how do you associate those with the change from baseline? Do the values at baseline have the same effect as the values at first follow-up? Should you be fitting two separate variables - for example, var1_base and var1_follow, var2_base and var2_follow, etc.?

 

SteveDenham

 

 

 

Kunko
Obsidian | Level 7

Thanks for your explanations. I am actually t modeling raw BP values over time (BP1 (baseline) and BP2(first follow-up). And Var1 is typo.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 2 replies
  • 558 views
  • 0 likes
  • 2 in conversation