Hello programmers,
I am trying to run a uni-variate procedure on a macro in which the input dataset and the output out= dataset needs to be a macro variable.
I want to run the macro for the whole data set and then for the dataset excluding a particular ID.
Please assume that my two datasets are 'one' and 'two', i will be glad for someone to help me check my syntax to see if it's correct and follows the rules for writing macros.
%macro Univariate (indata, outdata, run);
proc univariate data=&indata;
by grouporder groupname testcode testname;
var baseline _12_months change preslope postslpe slopedif;
output out=&outdata;
N= N_baseline N_12_months N_change N_preslope N_postslpe N_slopedif
Mean= Mean_baseline Mean_12_months Mean_change Mean_preslope Mean_postslpe Mean_slopedif
Std= std_baseline std_12_months std_change std_preslope std_postslpe std_slopedif
Probs= prob_baseline prob_12_months prob_change prob_preslope prob_postslpe prob_slopedif;
run;
indata=&indata;
outdata=&outdata;
run=&run;
%mend Univariate;
%Univariate (one, onea, 2);
%Univariate(two, twoa, 1);
run;
... View more