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
Explain data step in SAS
What are SAS/ACCESS and SAS/CONNECT?
Mention what is SAS data set?
How can you limit the variables written to output dataset in data step?
how to remove duplicates using proc sql?
What do you know about sas data set?
what are several options for creating reports in web report studio? : Sas-bi
If you need the value of a variable rather than the variable itself what would you use to load the value to a macro variable? : sas-macro
Explain what Proc glm does?
what is broad cast agent? : Sas-bi
What are common programming errors committed in sas
What is the difference between using drop = data set option in data statement and set statement?
Are you involved in writing the inferential analysis plan? Tables specfications?
what is sas application server? : Sas-di
what versions of sas have you used (on which platforms)? : Sas programming