Hello,
I am trying to complete a backward elimination analysis to select covariates for a logistic regression model. I would like to retain my key exposure variable (quartile_SDI) in the model, and only consider removing potential confounding variables, but I am struggling to figure out the code. Below is the code that I am using:
proc logistic data=pas.ranked_quart_3;
class RBC_4 (ref='0') ante_dx (ref='1') anemic (ref='0') anyDM (ref='0')/ param=ref;
model RBC_4 = quartile_SDI age BMI_delivery prior_CS ante_dx anyDM anemic
/ selection=backward fast slstay=0.1
ctable pprob=(0 to 1 by 0.05);
run;
Any guidance would be appreciated. Thank you for your help!
Alison
Hello @angouldi,
Use the INCLUDE= option of the MODEL statement: Insert include=1 after the slash (e.g., between your existing SLSTAY= and CTABLE options) and SAS will use the first explanatory effect listed in the MODEL statement, i.e., quartile_SDI, in every model during the variable selection process.
Thank you! This is exactly what I was looking for.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.