<?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: Logistic regression in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-regression/m-p/407476#M21217</link>
    <description>&lt;P&gt;To understand how a FREQ variable works, work through this example.&amp;nbsp; Compare the data sets X and X2 (the freq variable COUNT in X2 contains a count for each unique value).&amp;nbsp; Compare the two analyses.&amp;nbsp; They are identical.&amp;nbsp; Yes, you can use zero weights and freqs to exclude observations.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
   do i = 1 to 200;
      x = ceil(uniform(7) * 10);
      y = ceil(uniform(7) * 10);
      output;
      end;
   run;
   
proc reg data=x;
   model y = x;
   quit;
   
proc freq data=x noprint;
   tables x * y / out=x2;
   run;
   
proc reg data=x2;
   freq count;
   model y = x;
   quit;
   &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 25 Oct 2017 21:06:06 GMT</pubDate>
    <dc:creator>WarrenKuhfeld</dc:creator>
    <dc:date>2017-10-25T21:06:06Z</dc:date>
    <item>
      <title>Logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-regression/m-p/407350#M21211</link>
      <description>&lt;P&gt;Good afternoon,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I recently took over running some logistic code from a previous programmer and I am note sure why a "freq" line is included before the class statement in&amp;nbsp;the logistic procedure. Does anyone know what it does ? the probabilities I get are much higher when this line of code is included than when it is not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc logistic data=sponly DESCEND PLOTS(MAXPOINTS=NONE) ;&lt;BR /&gt;freq pending;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;class&lt;/P&gt;
&lt;P&gt;ageg4 (ref='5') /*ref=15-34*/&lt;BR /&gt; foreign (ref='1')&lt;BR /&gt; marital_status (ref='1') /*ref=Single*/&lt;BR /&gt; race (ref='2') /*ref=WNH*/&lt;BR /&gt; edu (ref='1') /*ref=High School or Less*/&lt;BR /&gt; gender (ref='2') /*ref=male*/&lt;BR /&gt; weekend (ref='0') /*ref=weekday*/&lt;BR /&gt; veteran_deaths(ref='2') /*ref=no veteran*/&lt;BR /&gt;;&lt;BR /&gt; &lt;BR /&gt;model opioidtotal = ageg4 foreign marital_status race edu gender weekend veteran_deaths&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/details rsquare ExpEst lackfit hierarchy=none CLPARM=Both CLODDS=Both /*CORRB CTABLE*/; roc; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;** Model only for all knowns **;&lt;/P&gt;
&lt;P&gt;where gender &amp;lt;&amp;gt; 9 and ageg4 &amp;lt;&amp;gt; 99 and race &amp;lt;&amp;gt;9 ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;** Create output data set for predictions **;&lt;/P&gt;
&lt;P&gt;output OUT=PRED_SP p=_prob lower=_lower upper=_upper / /*alpha=.01 this will be for 99% CI*/;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 16:13:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-regression/m-p/407350#M21211</guid>
      <dc:creator>malena</dc:creator>
      <dc:date>2017-10-25T16:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-regression/m-p/407354#M21212</link>
      <description>&lt;P&gt;FREQ is used when you have a single line of data representing multiple observations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, it will definitely change your results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;The FREQ statement identifies a&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=" aa-argument"&gt;variable&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;that contains the frequency of occurrence of each observation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_logistic_syntax18.htm&amp;amp;docsetVersion=14.2&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_logistic_syntax18.htm&amp;amp;docsetVersion=14.2&amp;amp;locale=en&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Two other things:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. Verify that &amp;lt;&amp;gt; is working as Not Equals, it actually means MAX in a SAS data step, but I'm not sure how it evaluates in a WHERE clause. Pretty sure it will be Not Equals, but it's worth a quick check.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. On the CLASS statement I would expect PARAM=REF to be somewhere, but I don't see that, unless you do want GLM parameterization.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 16:21:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-regression/m-p/407354#M21212</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-25T16:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-regression/m-p/407356#M21213</link>
      <description>&lt;P&gt;thank you- then we should remove that line since the&amp;nbsp;dataset only has one observation per person&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 16:31:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-regression/m-p/407356#M21213</guid>
      <dc:creator>malena</dc:creator>
      <dc:date>2017-10-25T16:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-regression/m-p/407359#M21214</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/52007"&gt;@malena&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;thank you- then we should remove that line since the&amp;nbsp;dataset only has one observation per person&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then why do the results change if FREQ PENDING is included? The variable is obviously not all 1's. Is it 1/0 so it's a method to exclude pending observations or only considering pending cases?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 16:37:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-regression/m-p/407359#M21214</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-25T16:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-regression/m-p/407367#M21215</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/52007"&gt;@malena&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;thank you- then we should remove that line since the&amp;nbsp;dataset only has one observation per person&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not necessarily, if the intent is to weight some observations more than others, or to exclude some observations which have a zero weight.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 16:50:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-regression/m-p/407367#M21215</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-10-25T16:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Logistic-regression/m-p/407476#M21217</link>
      <description>&lt;P&gt;To understand how a FREQ variable works, work through this example.&amp;nbsp; Compare the data sets X and X2 (the freq variable COUNT in X2 contains a count for each unique value).&amp;nbsp; Compare the two analyses.&amp;nbsp; They are identical.&amp;nbsp; Yes, you can use zero weights and freqs to exclude observations.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
   do i = 1 to 200;
      x = ceil(uniform(7) * 10);
      y = ceil(uniform(7) * 10);
      output;
      end;
   run;
   
proc reg data=x;
   model y = x;
   quit;
   
proc freq data=x noprint;
   tables x * y / out=x2;
   run;
   
proc reg data=x2;
   freq count;
   model y = x;
   quit;
   &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Oct 2017 21:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Logistic-regression/m-p/407476#M21217</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-10-25T21:06:06Z</dc:date>
    </item>
  </channel>
</rss>

