Code a PROC MEANS that shows both summed and averaged
output of the data.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / sreekanth rao
please correct me if my thought process is wrong.
question is to show only sum and avg...
proc means data=test sum mean;
by var (optional);
run;
here we are req only for sum mean. use out=new data set
name to print most recent data set.
Thanks
hi friends expecting the ansewrs.
Thanks
Sreekanth rao
| Is This Answer Correct ? | 3 Yes | 5 No |
Answer / sumit
proc means data=work.emp sum mean;
class deptno;
var sal;
run;
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / venkatesh.layam
proc means data=sashelp.calss means sum=total;
class gender;
var age;
run;
| Is This Answer Correct ? | 0 Yes | 3 No |
Answer / srini
Proc Means data=test noprint;
var var1 var2(optional)
output out=newdataset
sum= mean=;
run;
| Is This Answer Correct ? | 0 Yes | 8 No |
if reading an external file to produce an external file, what is the shortcut to write that record without coding every single variable on the record
How many versions came upto now in SAS?
Mention sas system options to debug sas macros.
what is the difference between informat$8. $char8.
Have you ever used the SAS Debugger?
i have a null dataset with 20 variables. i want to upload the variables which contain name like a or k or anything in another dataset.how can we create the dataset?
what are the three main credit bureau names
1 Answers Synchrony Financial,
How do you read in the variables that you need?
how to rearrange the data as our wish by using dataset block?
/*i have the following dataset.*/ data score; input marks ; datalines; 10 20 30 40 50 60 70 80 90 100 ; run; Now i should get the result as sum of 1 to 5 i.e(10+20+30+40+50)=150 and 2 to 6 i.e(20+30+40+50+60)=200 and 3 to 7 i.e(30+40+50+60+70)=250 and so on. how to get it. thanks in advance
What is the difference between Proc tabulate and Proc print
What is criteria for adverse events and treatment-emergent adverse events?