Please i have a dataset in which i want to keep only people who are aged from 0-5. The data set have list of people up to 17 years but i just want to create a dataset of only kids that are aged 0-5 and for the data-set to retain all the variables. The age variable is is sc_age.
I initially tried using the "where" statement in the larger data step to specify the category but it was not helpful as i will want to run a logistic regression later.
Please how do i go about this and any help will be appreciated.
Have you tried to subset the 0-5 age, using where statement, into a separate data-set
to be used for the regression?
data age0_5;
set have (where=(sc_age le 5); /* or between 0 and 5 - to exclude missing */
run;
Since I cant see your data, this code is untested.
data want;
set have;
where age between 0 and 5;
run;
Have you tried to subset the 0-5 age, using where statement, into a separate data-set
to be used for the regression?
data age0_5;
set have (where=(sc_age le 5); /* or between 0 and 5 - to exclude missing */
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.