Code a PROC MEANS that shows both summed and averaged
output of the data.

Answer Posted / amit nakrani

I think we can do it in following way. Please correct me if
it is wrong.

proc means noprint data = sourcedata;
var var1 var2;
by var3;(optional)
output out = newdata
sum(var1,var2) = SumVar1 SumVar2
mean(var1,var2) = MeanVar1 MeanVar2;
run;

proc print data = newdata;
run;

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How will you generate test data with no input data?

563


Differences between where and if statement?

586


what is sas application server? : Sas-di

541


how would you create multiple observations from a single observation? : Sas programming

570


What’s the difference between var b1 – b3 and var b1 — b3?

834






Do you need to compute new variables? If so,should you do this before you execute the report-writing procedure?

1470


what is a method for assigning first.var and last.var to the by groupvariable on unsorted data? : Sas programming

572


What will calendar procedure do?

601


Tell me more about the parameters in macro? : sas-macro

594


What is the use of the %include statement?

692


what versions of sas have you used (on which platforms)? : Sas programming

586


how are numeric and character missing values represented internally? : Sas programming

622


explain the difference between alternate key, business key, foreign key, generated key, primary key, retained key and surrogate key ? : Sas-di

545


explain the key concept of sas? : Sas-administrator

559


what is data access? : Sas-di

609