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 / sattwik kumar
data b;
set a end=lastobs;
age_temp+age;
count+1;
if lastobs then
mean=age_temp/count;
run;
| Is This Answer Correct ? | 19 Yes | 4 No |
Post New Answer View All Answers
What are the five ways to do a table lookup in sas? : sas-grid-administration
What is the difference between SAS functions and procedures?
What is the sas data set? : sas-grid-administration
What is auto call macro and how to create a auto call macro? What is the use of it? How to use it in sas with macros? : sas-macro
How will you use the WHO Drug Dictionary for Reporting Clinical Trials?
Tell me about % include and % eval? : sas-macro
where to use sas business intelligence? : Sas-bi
what are the categories that sas informats are used to the place the data? : Sas-administrator
WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?
what is snowflake schema? : Sas-di
What is the difference between using drop = data set option in data statement and set statement?
explain the difference between proc means and proc summary?
explain what is data set in sas? : Sas-administrator
What are the parameters of scan function?
What is the differnce between SDTM 3.1.2 to 3.1.1 version