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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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