sas - can't print median and mean at same time -


trying print median , mean @ same time, keep getting error

warning: variable margin exists on file work.statee1_margins.

warning: duplicate variables not included in output data set of output statement number 1.

proc means data = state1 noprint mean median nway missing; class ndc; var margin;  output out = state1_margins (drop = _type_) median= mean=; run; 

i want output set median in 1 column , mean in other. shouldn't able 1 proc?

you need tell name 2 variables.

proc means data = state1 noprint mean median nway missing; class ndc; var margin;  output out = state1_margins (drop = _type_) median= mean= /autoname autolabel; run; 

autoname tells make _, fine. can specify explicitly. autolabel tells add statistic label well.

proc means data = state1 noprint mean median nway missing; class ndc; var margin;  output out = state1_margins (drop = _type_) median=median_m mean=mean_m; run; 

or whatever prefer.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -