Hi guys, I am required to produce output like the image sample from the fitness data set. May I know the solutions? The questions is like: What is the highest runtime for male and female individuals in the fitness data file?
something like this
title 'max runtime for female'; proc sql; select max(runtime) as mxdata from sashelp.class where sex= 'F'; title; title 'max runtime for Male'; select max(runtime) as mxdata from sashelp.class where sex= 'M'; quit;
something like this
title 'max runtime for female'; proc sql; select max(runtime) as mxdata from sashelp.class where sex= 'F'; title; title 'max runtime for Male'; select max(runtime) as mxdata from sashelp.class where sex= 'M'; quit;
May i know, how can i get the "Obs" as the image shown.
proc sql number;
select max(runtime) as mxdata from sashelp.class
where sex= 'F';
title;
title 'max runtime for Male';
select max(runtime) as mxdata from sashelp.class
where sex= 'M';
quit;
but this shows up as ROW instead of obs as heading or use SAS undocumented function monotonic() as shown below
proc sql ;
select monotonic() as Obs, max(runtime) as mxdata from sashelp.class
where sex= 'F';
title;
title 'max runtime for Male';
select monotonic() as Obs, max(runtime) as mxdata from sashelp.class
where sex= 'M';
quit;
alternatively try the proc means
proc means data=have nway;
class sex;
var runtime;
output out=want max=max;
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.