For the given data set with uneven number of observations, either character or numeric, how can I find and display the middle observation?
Thank you greatly 🙂
Sample data and expected output. In the post rather than an attachment or image.
I am a bit confused... I know how to find the middle number in a numerical data set, however if I decide to use character variables, I am getting missing values in output.
Thank you.
Use nobs= to get the number of obs. Get the mid obs with point= option :
data test;
do txt = "abc","def","ghi","jkl","mno";
output;
end;
run;
data mid;
if 0 then set test nobs=n;
n = ceil(n/2);
set test point=n;
output;
stop;
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 save with the early bird rate—just $795!
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.