Hi,
How can I add second proc univariate to this:
proc univariate data=set_out;
by date;
weight w1;
VAR price;
run;
I want to obtain wieghted mean by group variable, using w2 as wieght.
@ab97_cd wrote:
Hi,
How can I add second proc univariate to this:
proc univariate data=set_out; by date; weight w1; VAR price; run;
I want to obtain wieghted mean by group variable, using w2 as wieght.
I'm sorry this just isn't clear to me. You can certainly add a second PROC UNIVARIATE to your code, so I'm not sure what your question really is.
If all you want is weighted means, use PROC SUMMARY and not PROC UNIVARIATE.
If you have a complex weighting (sampling) design then you probably will need to use PROCSURVEYMEANS instead of UNIVARIATE or MEANS.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.