Hello
I am looking to distribution of biomakers. I am interested to estimate age and sex adjusted medians for these variables. Is there a way to do it? This paper has decscribed it but unfortunately the SAS code is not provided (https://pubmed.ncbi.nlm.nih.gov/19028825/).
Any support will be appreciated.
Best wishes
AllEpi
Thank you for the suggestion. To clarify my question, this is about how to get the adjusted medians
in SAS. Now I am interested in getting Medians of the diastolic blood pressure across the quantiles of
of the systolic blood pressure but adjusted for ageatstart and sex in the sashelp.heart dataset.
When I run your code I get "Non-est". I get the same message, if I change the variable. Any further toughts on this?
Look into using PROC QUANTREG.
Thank you for the helpful posts. My question was related to getting adjusted medians. I am aware of how to get quartile with confidence intervals from a post by @Rick_SAS (https://blogs.sas.com/content/iml/2017/02/22/difference-of-medians-sas.html). However, that gives me unadjusted medians as there is nothing on the right side of the model!.
There is also option to predict the quantiles. Using this approach, I proceed to calculate the adjusted (predicted medians, using q=0.5). For example in the sashelp.heart study if I am interested to know the median of the diastolic blood pressure across the quartiles of the systolic pressure, this is how I got the medians adjusted for age at start and sex.
*First I make quartiles of the systolic blood pressure;
proc rank data=sashelp.heart groups=4 out=heart;
var Systolic;
ranks sys;
run;
*Then I get age and sex adjusted predicted diastolic blood pressure;
proc quantreg data=heart ci=sparsity/iid algorithm=interior(tolerance=1.e-4);
class sex;
model diastolic =ageatstart sex / quantile=0.5;
output out=predictquant p=predquant;
run;
"Then I get adjusted medians (from predicted systolic blood pressure called predquant) across the quartiles of systolic blood pressure (sys), I keep original variable to get the difference in medians;
proc means data=predictquant median;
class sys;
var diastolic predquant ;
run;
I can see that the difference between median of the original variable and predicted (which is adjusted for age and sex). On a side note, to cross check my result when I added used height only for adjustment (assuming it will be less related to diastolic blood pressure), I get median of the original as well as predicted diastolic blood pressure as same.
Now the question is: Is this a correct approach to get adjusted medians (The question is not about whether this is a correct data anlaysis approach!)
Thanks in advance
"adjusted medians " for what ? or how to get it ?
If you means it like Linear Regression Model , you can use LSMEANS or ESTIMATE to get it ,as you showed Rick blog:
https://blogs.sas.com/content/iml/2017/02/22/difference-of-medians-sas.html
proc quantreg data=heart ci=sparsity algorithm=interior(tolerance=1.e-4); class sex; model diastolic =ageatstart sex / quantile=0.5; estimate 'Adjusted Medians of Female' sex 1 0 / CL; estimate 'Adjusted Medians of Male' sex 0 1 / CL; run;
Thank you for the suggestion. To clarify my question, this is about how to get the adjusted medians
in SAS. Now I am interested in getting Medians of the diastolic blood pressure across the quantiles of
of the systolic blood pressure but adjusted for ageatstart and sex in the sashelp.heart dataset.
When I run your code I get "Non-est". I get the same message, if I change the variable. Any further toughts on this?
Opps. I missed a INTERCEPT term to score a set of X variables when using ESTIMATE.
proc quantreg data=sashelp.heart ci=sparsity algorithm=interior(tolerance=1.e-4);
class sex;
model diastolic =systolic ageatstart sex / quantile=0.5;
estimate 'Adjusted Medians of diastolic when systolic=148,ageatstart=33,sex=Female'
intercept 1 systolic 148 ageatstart 33 sex 1 0 / CL;
run;
Here 148 is 75 percentile of systolic ,33 is 50 percentile of ageatstart.
The analysis you showed with PROC RANK and PROC QUANTREG looks reasonable to me.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.