Help using Base SAS procedures

How to flag used observations in regression model?

Reply
New Contributor
Posts: 3

How to flag used observations in regression model?

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?
Valued Guide
Posts: 2,174

Re: How to flag used observations in regression model?

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 ;
Trusted Advisor
Posts: 2,113

Re: How to flag used observations in regression model?

You could output a dataset that includes the predicted risk and then subset on that value being non-missing.
Ask a Question
Discussion stats
  • 2 replies
  • 92 views
  • 0 likes
  • 3 in conversation