Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

what is the difference between infile and input? : Sas-administrator

1062


How to import multiple xls files into sas. Out of those files, how to get different values from a single variable and how to find number of rows per value type? We can do this using group by for one xls file with proc sql. Was wondering how I can achieve this for multiple files at the same time. Any ideas?

2855


for whom is sas data integration studio designed? : Sas-di

946


Mention what is PROC in SAS?

1009


What is the difference between %put and symbolgen? : sas-macro

1158


what cause the "error: connect:" and "error in the libname statement" when there weren't any such problems?

2125


How would you identify a macro variable? : sas-macro

968


why is sas data integration studio important? : Sas-di

976


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

993


Differences between where and if statement?

1024


If you were told to create many records from one record, show how you would do this using array and with proc transpose?

1415


what are the best practices to process the large data sets in sas programming? : Sas-administrator

960


Did you used proc test? when?

1981


WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?

2736


Explain proc sort?

1028