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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.