BookmarkSubscribeRSS Feed
N1d70
Calcite | Level 5

Hi all,

I am doing a matched (1:10) case-control study looking at the association between income (in ranks) and the risk of stroke.

I use conditional logistic regression:

 

PROC LOGISTIC desc data = stroke;
strata = matched;
model stroke (event = '1') = INCOMErank;
RUN;
    • matched = matching variable
    • stroke: 0 = no stroke, 1 = stroke

Now I wish to look at potential non-linearity using cubic splines with knots at the 20, 50, 80th percentile of INCOME rank. Moreover, I wish to output the odds ratio for each rank compared to the 50th percentile INCOME rank. My goal is to achieve a figure with odds ratios on the y-axis and income-ranks on the x-axis.

  1. How would you do cubic splines with knots in conditional logistic regression? 
  2. How do you obtain odds ratios comparing each rank to a reference for a continuous variable?

Thank you for your time.

1 REPLY 1
pink_poodle
Barite | Level 11
1. You can re-use the code from here, combining it with what you have written:
https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-Restricted-Cubic-Spline-in-PROC-LO...
2. "ods output ParameterEstimates=Lgsparms;" line from above link may take care of that.
Also you may try adding the "ods output Logistic.CLoddsPL = o;" before the logistic procedure and add "/orpvalue" option to the model statement. The p-values will be in the "o" dataset.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 805 views
  • 0 likes
  • 2 in conversation