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.

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

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