I would like to see the weighted average in a proc tabulate. How would I go about this?
proc tabulate data=Result;
var ltv_max_onoff;
class Exposure_class_std_method;
table Exposure_class_std_method, ltv_max_onoff*mean;
run;
I figure I need to specify something else after the "ltv_max_onoff". Also I would need to specify what variable I would like to weight it on. A similar code that does work is the Proc Summary:
proc summary data=Result nway;
var ltv_max_onoff;
weight exp_distr_onoff;
output out=WALTV (drop=_:) mean= ;
run;
I would like this operation to be done in each category of the Proc Tabulate (Exposure_class_std_method).
I have tried putting the weight command in the "var" statement
proc tabulate data=Result;
var ltv_max_onoff weight=exp_distr_onoff;
class Exposure_class_std_method;
table Exposure_class_std_method, ltv_max_onoff;
run;
It's not recognised: