<?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: Table with weighted % in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Table-with-weighted/m-p/719274#M34797</link>
    <description>&lt;P&gt;Use the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=proc&amp;amp;docsetTarget=p0ctnx21fdgs7qn1jgolu1ihl7kf.htm&amp;amp;locale=en" target="_self"&gt;Weight Statement&lt;/A&gt; in Proc Summary.&lt;/P&gt;</description>
    <pubDate>Mon, 15 Feb 2021 06:55:42 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2021-02-15T06:55:42Z</dc:date>
    <item>
      <title>Table with weighted %</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Table-with-weighted/m-p/719262#M34795</link>
      <description>&lt;P&gt;I have created variables for multiple conditions based on whether the response to having them was yes or no. And a new variable for whether before a policy was implemented or after (year_class). Now, I want to create a table with weighted counts and percentages for each of these conditions. I am not sure how to create one table for all conditions. At the moment I am using below code to get the count for each condition(angipecev, cerebpalev,etc) where would the weight statement go here? How do I get one table for all conditions with weighted percentages? I have not used SAS much so apologies if this is something as easy as a Table statement could have done. Thank you in advance for the help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select distinct count(nhispid) INTO: count&lt;BR /&gt;from thesis.mydata&lt;BR /&gt;where year_class=1 and angipecev=1;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 04:24:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Table-with-weighted/m-p/719262#M34795</guid>
      <dc:creator>drteju</dc:creator>
      <dc:date>2021-02-15T04:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Table with weighted %</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Table-with-weighted/m-p/719273#M34796</link>
      <description>&lt;P&gt;Proc SQL is not meant to do "weighted" anything. You can force it but takes more work.&lt;/P&gt;
&lt;P&gt;What is wrong with Proc Freq, Means, Report or Tabulate to make a weighted table?&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Proc freq data=thesis.mydata;
   tables nhispid;
   weight &amp;lt;what ever variable you have for weighting&amp;gt;;
   where year_class=1 and angipecev=1;
run;&lt;/PRE&gt;
&lt;P&gt;You should be prepared to share some example data the actual desired or expected result.&lt;/P&gt;
&lt;P&gt;I am almost afraid that the way you have phrased your question with "I have created variables for multiple conditions based on whether the response to having them was yes or no" that the way you did that may make it harder to do analysis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what did you expect to do with that macro variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 06:53:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Table-with-weighted/m-p/719273#M34796</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-15T06:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Table with weighted %</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Table-with-weighted/m-p/719274#M34797</link>
      <description>&lt;P&gt;Use the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=proc&amp;amp;docsetTarget=p0ctnx21fdgs7qn1jgolu1ihl7kf.htm&amp;amp;locale=en" target="_self"&gt;Weight Statement&lt;/A&gt; in Proc Summary.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 06:55:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Table-with-weighted/m-p/719274#M34797</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-02-15T06:55:42Z</dc:date>
    </item>
  </channel>
</rss>

