<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Proc summary, Weight in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-Weight/m-p/778484#M247797</link>
    <description>Thanks for the response.&lt;BR /&gt;Yes. Proc Freq is the normal way for the count. &lt;BR /&gt;I am using PROC SUMMARY, due to try not to change the reference program I got from others , but I need to add weight for the patients.</description>
    <pubDate>Thu, 04 Nov 2021 13:10:40 GMT</pubDate>
    <dc:creator>Ivy</dc:creator>
    <dc:date>2021-11-04T13:10:40Z</dc:date>
    <item>
      <title>Proc summary, Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-Weight/m-p/778400#M247765</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am applying weight statement at proc summary below.&lt;/P&gt;
&lt;P&gt;However, it did not bring the weighted count.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am wondering how this can work.&amp;nbsp; &amp;nbsp;Thanks.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Just use proc summary , no proc freq).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc summary data=a1 chartype completetypes;&lt;BR /&gt;class treatment;&lt;BR /&gt;types treatment;&lt;BR /&gt;weight IPW; /*weight dose not work?*/&lt;BR /&gt;output out=ae_1; &lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 01:57:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-Weight/m-p/778400#M247765</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2021-11-04T01:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary, Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-Weight/m-p/778415#M247769</link>
      <description>&lt;P&gt;If your IPW variable is a count then you likely mean to use FREQ not Weight statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc summary data=a1 chartype completetypes;
class treatment;
types treatment;
Freq IPW; 
output out=ae_1;
quit;

 &lt;/PRE&gt;
&lt;P&gt;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).&lt;/P&gt;
&lt;P&gt;Weight will not change the sample size the way Freq does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 03:27:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-Weight/m-p/778415#M247769</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-11-04T03:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary, Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-Weight/m-p/778468#M247783</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;However, it did not bring the weighted count.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can compute the sumwgt statistic.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=a1 chartype;
class treatment;
weight IPW; 
output out=ae_1 sumwgt=sum_weights /* Other statistics required go here */;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Nov 2021 11:23:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-Weight/m-p/778468#M247783</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-04T11:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary, Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-Weight/m-p/778483#M247796</link>
      <description>Thanks Paige for the suggestion. &lt;BR /&gt;I customized your code , "adding var statement" as below, then it works! &lt;BR /&gt;proc summary data=a1 chartype completetypes;&lt;BR /&gt;class treatment;&lt;BR /&gt;types treatment;&lt;BR /&gt;var ipw;&lt;BR /&gt;weight IPW;&amp;nbsp;&lt;BR /&gt;output out=ae_1 sumwgt=sum_weights;&lt;BR /&gt;quit;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Nov 2021 13:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-Weight/m-p/778483#M247796</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2021-11-04T13:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary, Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-Weight/m-p/778484#M247797</link>
      <description>Thanks for the response.&lt;BR /&gt;Yes. Proc Freq is the normal way for the count. &lt;BR /&gt;I am using PROC SUMMARY, due to try not to change the reference program I got from others , but I need to add weight for the patients.</description>
      <pubDate>Thu, 04 Nov 2021 13:10:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-Weight/m-p/778484#M247797</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2021-11-04T13:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc summary, Weight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-summary-Weight/m-p/778486#M247798</link>
      <description>The following is much clear to understand the weighted count by proc summary. &lt;BR /&gt;&lt;BR /&gt;proc summary data=a1 chartype completetypes;&lt;BR /&gt;class treatment;&lt;BR /&gt;types treatment;&lt;BR /&gt;var ipw;&lt;BR /&gt;output out=ae_1 sum=sum_weights;&lt;BR /&gt;quit;</description>
      <pubDate>Thu, 04 Nov 2021 13:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-summary-Weight/m-p/778486#M247798</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2021-11-04T13:13:23Z</dc:date>
    </item>
  </channel>
</rss>

