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

what is the difference between: x=a+b+c+d; and x=sum (of a, b, c ,d);? : Sas programming

602


how could you generate test data with no input data? : Sas programming

617


What is the difference between match merge and one to one merge?

680


Mention how to limit decimal places for the variable using proc means?

639


What are the different types of sas functions?

603






how to remove duplicates using proc sql?

622


Differentiate input and infile.

592


what do the pad and dim functions do? : Sas programming

560


what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming

583


data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt<=y.enddt; quit; Here, we are getting cartision product. But,I want left join report consisting of this program. It should not get duplicate values. you can modify the program also.

1791


explain about various caches available in data integrator? : Sas-di

574


What is the sas data set? : sas-grid-administration

562


how to change the execute of macro

1667


What is the difference between where and if statement?

611


Briefly explain input and put function?

621