BookmarkSubscribeRSS Feed
angouldi
Fluorite | Level 6

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

 

2 REPLIES 2
FreelanceReinh
Jade | Level 19

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.

angouldi
Fluorite | Level 6

Thank you! This is exactly what I was looking for. 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

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