BookmarkSubscribeRSS Feed
sjmoussa
Calcite | Level 5
When I perform a logistic regression model using about 50 predictor variables my sample size decreases from n=18500 to n=7468 due to missing data on some of the variables. I want to create a new dataset that only includes the complete cases (n=7468). Is there an easy way to do this in SAS?
2 REPLIES 2
Peter_C
Rhodochrosite | Level 12
if these predictor variables are
1 : all numeric
and
2 : listed in macro variable &predictors
data new_dataset ;
set old_dataset ;
if nmiss( of &predictors ) > 0 then delete ;
run ;
Doc_Duke
Rhodochrosite | Level 12
You could output a dataset that includes the predicted risk and then subset on that value being non-missing.

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1322 views
  • 0 likes
  • 3 in conversation