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
Hello Friends, am new to this forum and am not good at sas progarmming. please can any one of you send me couple of sample large sample SAS Jobs which can you use 200 MB of data and other sas job upto 25GB of data. am doing a performance testing on our legacy systems and new upgraded system. I would really appreciate if you can do me this favor Thank you Priya
How do dates work in SAS data?
Mention some common errors that are usually committed in sas programming.
what is snowflake schema? : Sas-di
how do you pull data from equifax?tell me the process?
Tell me more about the parameters in macro? : sas-macro
How does the internal authentication work in sas? : sas-grid-administration
What are pdv and it functions?
What is the use of the %include statement?
what is information maps?
Give some examples where proc report’s defaults are different than proc print’s defaults?
What are the best sas programming practices for handling very large datasets? : sas-grid-administration
what is the basic structure sas administrator? : Sas-administrator
Explain substr function?
Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro