Can you calculate the mean, median and mode of the following data set
using data step logic? Don't use any function or procedure.
data a;
input age @@;
datalines;
22 32 32 32 43 23 24 56 45 54 28 29 27 26 25 28 30 20 18 37 36 47 46
56 19 20
;
run;
I have calculated the mean which i have posted in the answer section.
Answer Posted / ravikumar
Answer:
data new;
set a end = last;
count+1;
age_n+age;
if last then do;
mean = round(((age_n)/(count)),.8);
median = ((count+1)/2);
end;
run;
By the above program we can calculate the mean and median.
lets us know me, if anybody find the logic for find mode
Is This Answer Correct ? | 0 Yes | 6 No |
Post New Answer View All Answers
How does the internal authentication work in sas? : sas-grid-administration
Difference between SAS STATA & SPSS?
how to create the AE dataset by using SDTMIG specifications and SAP plan by using UNIX platform?
What are the default statistics for means procedure?
which date functions advances a date time or date/time value by a given interval? : Sas programming
do you prefer proc report or proc tabulate? Why? : Sas programming
Name some categories in sas 9? : sas-grid-administration
What are the difference between ceil and floor functions in sas?
How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?
What does proc print, and proc contents are used for?
Mention the difference between ceil and floor functions in sas?
How do you connect the desktop application to metadata server? : sas-grid-administration
What is a macro routine?
What are the difference between sas functions and procedures?
What is SAS informats?