Hi everyone,
I want to summarize all variables and to calulate mean juste for one variable x. my proc summary is it correct ?
proc summary data=table_tosum ;
var &variables_to_sum.;
by DD DF;
id a b c d &other_variables. ;
output out=table (drop= _TYPE_ _FREQ_ _ORGA ) sum()= mean(x)=;
run;
thanks.
Run it and checking is faster than waiting for a response.
What is _ORGA?
If you want the sum of all variables, as part of the OUTPUT statement remove the parentheses and use:
sum=
Run it and checking is faster than waiting for a response.
@amager wrote:
Hi everyone,
I want to summarize all variables and to calulate mean juste for one variable x. my proc summary is it correct ?
proc summary data=table_tosum ; var &variables_to_sum.; by DD DF; id a b c d &other_variables. ; output out=table (drop= _TYPE_ _FREQ_ _ORGA ) sum()= mean(x)=; run;
thanks.
Placing the fixed name of a variable into one position of code such as mean(x) when that variable is not explicitly listed on the var statement is a likely point of code failure in the future when the macro variable &variables_to_sum does not contain x.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.