<?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 Weighting issue in Proc Tabulate in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Weighting-issue-in-Proc-Tabulate/m-p/477846#M123142</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to generate weighted percentages by using the below codes but it generates un-weigted percentages.&lt;/P&gt;&lt;P&gt;My weight variable is discwt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data redo_t1;
	input ID discwt 3.1 cat_flag race;
	datalines; 
		01 0.2 1 1
		02 0.4 1 2
		03 0.4 1 1
		04 0.4 1 2
		05 0.4 1 1
		06 0.1 3 2
		07 1.2 3 1
		08 0.4 3 2
		09 1.0 3 1
		10 0.4 3 2
	;
run;

proc tabulate data = work.redo_t1;
	title 'Table 1a';
	class cat_flag race ; 
	table race, (cat_flag)*(N colpctn);
	var discwt / weight = discwt;
	weight discwt;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jul 2018 12:09:15 GMT</pubDate>
    <dc:creator>Bedi</dc:creator>
    <dc:date>2018-07-13T12:09:15Z</dc:date>
    <item>
      <title>Weighting issue in Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weighting-issue-in-Proc-Tabulate/m-p/477846#M123142</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to generate weighted percentages by using the below codes but it generates un-weigted percentages.&lt;/P&gt;&lt;P&gt;My weight variable is discwt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data redo_t1;
	input ID discwt 3.1 cat_flag race;
	datalines; 
		01 0.2 1 1
		02 0.4 1 2
		03 0.4 1 1
		04 0.4 1 2
		05 0.4 1 1
		06 0.1 3 2
		07 1.2 3 1
		08 0.4 3 2
		09 1.0 3 1
		10 0.4 3 2
	;
run;

proc tabulate data = work.redo_t1;
	title 'Table 1a';
	class cat_flag race ; 
	table race, (cat_flag)*(N colpctn);
	var discwt / weight = discwt;
	weight discwt;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 12:09:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weighting-issue-in-Proc-Tabulate/m-p/477846#M123142</guid>
      <dc:creator>Bedi</dc:creator>
      <dc:date>2018-07-13T12:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Weighting issue in Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weighting-issue-in-Proc-Tabulate/m-p/477847#M123143</link>
      <description>&lt;P&gt;I don't know what you are trying to do here, but you can't weight a variable by itself. That simply doesn't make any sense from a mathematical point of view. Please type in the desired output from this data set, and how the desired output is computed, and perhaps someone can generate code to produce the desired output.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 12:16:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weighting-issue-in-Proc-Tabulate/m-p/477847#M123143</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-13T12:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Weighting issue in Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weighting-issue-in-Proc-Tabulate/m-p/477890#M123167</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data redo_t1;
	input ID discwt 3.1 cat_flag race;
    counter=1;
	datalines; 
		01 0.2 1 1
		02 0.4 1 2
		03 0.5 1 1
		04 0.4 1 2
		05 0.4 1 1
		06 0.1 3 2
		07 1.2 3 1
		08 0.4 3 2
		09 1.0 3 1
		10 0.4 3 2
	;
run;

title 'with weights';
proc tabulate data = work.redo_t1;
	title 'Table 1a';
	class cat_flag race ; 
    var counter;
    weight discwt;
	table race, (cat_flag)*counter*(sum colpctn);

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Jul 2018 14:52:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weighting-issue-in-Proc-Tabulate/m-p/477890#M123167</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-13T14:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Weighting issue in Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weighting-issue-in-Proc-Tabulate/m-p/478103#M123241</link>
      <description>Thanks for the revert.&lt;BR /&gt;&lt;BR /&gt;I tried the code, it does gives me weighted count but the percentages from&lt;BR /&gt;'COLPCTN' are still unweighted.&lt;BR /&gt;</description>
      <pubDate>Sat, 14 Jul 2018 09:54:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weighting-issue-in-Proc-Tabulate/m-p/478103#M123241</guid>
      <dc:creator>Bedi</dc:creator>
      <dc:date>2018-07-14T09:54:13Z</dc:date>
    </item>
  </channel>
</rss>

