I have a person level dataset with three categorical variables V1, V2 and V3. I want to use Proc Tabulate to calculate means of variable X1, X2, and X3 by the three categories listed above as well as a count of persons and the percentage out of V1 and V2 (i.e when V3 is all). Here is my first attempt.
Proc tabulate date = in_data
Out = out_data;
Var X1 X2 X3;
Class V1 V2 V3;
Table (V1 all) * (V2 all) * (V3 all), N mean pctn<V1 V2>;
Run;
This gives me the error message “Statistics other than N was requested without analysis variable in the following nesting V1*V2*V3*Mean”. I don’t think I have the syntax quite right. Any ideas on how I can fix it? Thanks.