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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.