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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.