<?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 logistic with class variable - weighted vs. unweighted in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-logistic-with-class-variable-weighted-vs-unweighted/m-p/249420#M56521</link>
    <description>&lt;P&gt;Thank you, now it is clear.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Feb 2016 11:15:12 GMT</pubDate>
    <dc:creator>Gabee</dc:creator>
    <dc:date>2016-02-11T11:15:12Z</dc:date>
    <item>
      <title>Proc logistic with class variable - weighted vs. unweighted</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-logistic-with-class-variable-weighted-vs-unweighted/m-p/249148#M56504</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I came across a problem when I ran proc logistic with class variable with weights and without weights. For some cases I got "close" the same estimates while for others totally diferrent.&lt;/P&gt;
&lt;P&gt;The input data set (SAMPLE.zip - 60 rows) is attachted to this post as well as the SAS code I executed.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sample.sample;
 by class_var var1 var2;
run;

/*Generate weights*/
proc summary data=sample.sample nway;
 class class_var var1 var2 target_var;
 output out=sample.weights(drop=_type_ rename=(_freq_= weight));
run;
/*With weights*/
proc logistic data = sample.weights;
 class class_var /param = GLM;
 model target_var(EVENT = '1') = class_var  var1 * class_var  var2 * class_var /noint;
 weight weight;
 ods output ParameterEstimates = sample.wparamest Association = sample.wassocest;
run;
title;
/*Without weights*/
proc logistic data = sample.sample;
 class class_var /param = GLM;
 model target_var(EVENT = '1') = class_var  var1 * class_var  var2 * class_var /noint;
 ods output ParameterEstimates = sample.paramest Association = sample.assocest;
run;
title;

proc compare base=sample.paramest compare=sample.wparamest;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are two cases:&lt;/P&gt;
&lt;P&gt;1. Using the sample data set without weights (in this case the input table has 60 rows)&lt;/P&gt;
&lt;P&gt;2. Using the weights table containing the weight variable that is also used in the proc logistic.&amp;nbsp;&lt;SPAN&gt;(in this case the input table has 57&amp;nbsp;rows, in 3 cases the weights are 2).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When I compare the results I get differencies as follows:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1826i1691E8AC5B00FC47/image-size/medium?v=mpbl-1&amp;amp;px=-1" border="0" alt="proc compare.JPG" title="proc compare.JPG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Could you please tell me what could cause these&amp;nbsp;differencies?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BR,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Gabor&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 08:19:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-logistic-with-class-variable-weighted-vs-unweighted/m-p/249148#M56504</guid>
      <dc:creator>Gabee</dc:creator>
      <dc:date>2016-02-10T08:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc logistic with class variable - weighted vs. unweighted</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-logistic-with-class-variable-weighted-vs-unweighted/m-p/249186#M56506</link>
      <description>&lt;P&gt;You are confusing the WEIGHT statement with the FREQ statement.&amp;nbsp; If you use a FREQ statement in the first PROC LOGISTIC call, the values agree to within about 1e-15, which is what you would expect. For details, see &lt;A href="http://blogs.sas.com/content/iml/2013/09/13/frequencies-vs-weights-in-regression.html" target="_self"&gt;"The difference between frequencies and weights in regression analysis".&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 13:51:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-logistic-with-class-variable-weighted-vs-unweighted/m-p/249186#M56506</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-02-10T13:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc logistic with class variable - weighted vs. unweighted</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-logistic-with-class-variable-weighted-vs-unweighted/m-p/249400#M56518</link>
      <description>&lt;P&gt;Thank you Rick for your comment, using FREQ instead of WEIGHT solved my problem.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;There is still one thing that is not clear for me.&amp;nbsp;In the article you say the followings:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. "A frequency variable tells the procedure that there are more observations than there are rows in the data set. When you run a frequency analysis, your analysis should agree with the same analysis run on the "expanded data," which is the data set in which each row represents a single observation." &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. "In the regression context, if you use integer counts as weights, the parameter estimates are the same as when you use the counts for frequencies".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;From 1 and 2 I&amp;nbsp;have the parameter estimates with integer weights = parameter estimates with frequencies = parameter estimates for the "expanded data". &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;However, in my&amp;nbsp;&lt;SPAN&gt;test case this clearly does NOT hold since some of my&amp;nbsp;parameter estimates are different. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What could be the issue here?&lt;BR /&gt;&lt;BR /&gt;Thank you for your answer.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 09:55:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-logistic-with-class-variable-weighted-vs-unweighted/m-p/249400#M56518</guid>
      <dc:creator>Gabee</dc:creator>
      <dc:date>2016-02-11T09:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc logistic with class variable - weighted vs. unweighted</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-logistic-with-class-variable-weighted-vs-unweighted/m-p/249408#M56520</link>
      <description>&lt;P&gt;I wrote that article for LINEAR regression. As you have observed, the weights affect the parameter estimates nonlinearly in logisitc regression and other generalized regression models.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 10:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-logistic-with-class-variable-weighted-vs-unweighted/m-p/249408#M56520</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-02-11T10:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc logistic with class variable - weighted vs. unweighted</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-logistic-with-class-variable-weighted-vs-unweighted/m-p/249420#M56521</link>
      <description>&lt;P&gt;Thank you, now it is clear.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 11:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-logistic-with-class-variable-weighted-vs-unweighted/m-p/249420#M56521</guid>
      <dc:creator>Gabee</dc:creator>
      <dc:date>2016-02-11T11:15:12Z</dc:date>
    </item>
  </channel>
</rss>

