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


Please Help Members By Posting Answers For Below Questions

How does the internal authentication work in sas? : sas-grid-administration

579


Difference between SAS STATA & SPSS?

674


how to create the AE dataset by using SDTMIG specifications and SAP plan by using UNIX platform?

2284


What are the default statistics for means procedure?

636


which date functions advances a date time or date/time value by a given interval? : Sas programming

531






do you prefer proc report or proc tabulate? Why? : Sas programming

568


Name some categories in sas 9? : sas-grid-administration

551


What are the difference between ceil and floor functions in sas?

702


How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?

740


What does proc print, and proc contents are used for?

607


Mention the difference between ceil and floor functions in sas?

640


How do you connect the desktop application to metadata server? : sas-grid-administration

576


What is a macro routine?

2095


What are the difference between sas functions and procedures?

634


What is SAS informats?

629