Hello,
I am applying weight statement at proc summary below.
However, it did not bring the weighted count.
I am wondering how this can work. Thanks.
(Just use proc summary , no proc freq).
proc summary data=a1 chartype completetypes;
class treatment;
types treatment;
weight IPW; /*weight dose not work?*/
output out=ae_1;
quit;
If your IPW variable is a count then you likely mean to use FREQ not Weight statement.
proc summary data=a1 chartype completetypes; class treatment; types treatment; Freq IPW; output out=ae_1; quit;
Freq uses the variable as a count of records where all the variables are the same.(or at least the one you are using for other statements in the procedure).
Weight will not change the sample size the way Freq does.
However, it did not bring the weighted count.
You can compute the sumwgt statistic.
proc summary data=a1 chartype;
class treatment;
weight IPW;
output out=ae_1 sumwgt=sum_weights /* Other statistics required go here */;
quit;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.