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


Please Help Members By Posting Answers For Below Questions

I have a dataset concat having variable a b & c. How to rename a b to e & f?

580


What are the statements that are executed only?

674


Give some examples where proc report’s defaults are different than proc print’s defaults?

599


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

583


Explain substr function?

577






What is Linear Regression?

687


What does P-value signify about the statistical data?

853


What are the parameters of scan function?

620


what is the function of catx syntax? : Sas-administrator

652


Explain what Proc glm does?

637


i have a dataset with 100 obs i want to generate title from 20th obs onwards with total observations. that should contain 100 obs.dont use firstobs and dnt split the data. use dataset block or proc report? how can we genarate;

1969


Differentiate between format and informat? : sas-grid-administration

580


what is sas enterprise intelligence architecture? : Sas-bi

544


what are informats in sas? : Sas-administrator

588


what is the use of proc sql? : Sas programming

594