<?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: All observations have the same response. No statistics are computed. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/All-observations-have-the-same-response-No-statistics-are/m-p/727677#M80316</link>
    <description>&lt;P&gt;This may not be related to proc logistic, but I was curious about the following.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If previous="Condom us" then previous=0;
If previous="No condom" then previous=1;
Else previous=2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I think there is an else missing in the second if, and all previous=0 assigned in the previous if statement will become previous=2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code might be better.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If previous="Condom us" then previous=0;
Else If previous="No condom" then previous=1;
Else previous=2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Mar 2021 07:47:52 GMT</pubDate>
    <dc:creator>japelin</dc:creator>
    <dc:date>2021-03-19T07:47:52Z</dc:date>
    <item>
      <title>All observations have the same response. No statistics are computed.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/All-observations-have-the-same-response-No-statistics-are/m-p/727667#M80315</link>
      <description>&lt;PRE&gt;Filename Refile '/home/u49589061/MPBH 421/Programs/condom.csv';&lt;BR /&gt;&lt;BR /&gt;Proc import Datafile=Refile&lt;BR /&gt;	DBMS=CSV&lt;BR /&gt;	Out=work.condom;&lt;BR /&gt;	Getnames=YES;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;Proc contents data=work.condom;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;Proc print data=work.condom;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Data condom1;&lt;BR /&gt;Set work.condom;&lt;BR /&gt;If gender="male" then gender=0;&lt;BR /&gt;Else gender=1;&lt;BR /&gt;If use="unprotected" then use=0;&lt;BR /&gt;Else use=1;&lt;BR /&gt;If safety gt 5 then delete;&lt;BR /&gt;If sexexp gt 10 then delete;&lt;BR /&gt;If previous="Condom us" then previous=0;&lt;BR /&gt;If previous="No condom" then previous=1;&lt;BR /&gt;Else previous=2;&lt;BR /&gt;If selfcon gt 9 then delete;&lt;BR /&gt;If perceive gt 6 then delete;&lt;BR /&gt;Previous1 = previous EQ 1;&lt;BR /&gt;Previous2 = previous EQ 2;&lt;BR /&gt;Run;&lt;BR /&gt;*****************************************************;&lt;BR /&gt;Proc logistic data=condom1;&lt;BR /&gt;class gender/param=ref;&lt;BR /&gt;Model use(ref=last)=perceive safety gender/expb cl rsq;&lt;BR /&gt;Output Out=condomres1 pred=pred;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;PROC LOGISTIC DATA=condom;&lt;BR /&gt;Class gender/param=ref;&lt;BR /&gt;MODEL  use (REF="0")=  perceive safety gender previous1 previous2 selfcon sexexp /EXPB CL RSQ;&lt;BR /&gt;OUTPUT OUT=condomres2 PRED=pred   ;&lt;BR /&gt;Test previous1=0,  previous2=0,  selfcon=0,  sexexp=0;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;- I need some major help for the following two parts:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, I'm trying to make dummy variables for the variable: previous&amp;nbsp;Previous1 = previous EQ 1;&lt;BR /&gt;Previous2 = previous EQ 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second, I am currently running into problems with running the last two proc logistics statements. After I run the first proc logistic statement, it states that "All observations have the same response. No statistics are computed." And then when I run the second proc logistic statement, it states that the "variable previous1 was not found."&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 06:54:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/All-observations-have-the-same-response-No-statistics-are/m-p/727667#M80315</guid>
      <dc:creator>u49589061</dc:creator>
      <dc:date>2021-03-19T06:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: All observations have the same response. No statistics are computed.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/All-observations-have-the-same-response-No-statistics-are/m-p/727677#M80316</link>
      <description>&lt;P&gt;This may not be related to proc logistic, but I was curious about the following.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If previous="Condom us" then previous=0;
If previous="No condom" then previous=1;
Else previous=2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I think there is an else missing in the second if, and all previous=0 assigned in the previous if statement will become previous=2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code might be better.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If previous="Condom us" then previous=0;
Else If previous="No condom" then previous=1;
Else previous=2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 07:47:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/All-observations-have-the-same-response-No-statistics-are/m-p/727677#M80316</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-03-19T07:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: All observations have the same response. No statistics are computed.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/All-observations-have-the-same-response-No-statistics-are/m-p/727683#M80317</link>
      <description>&lt;P&gt;For your second LOGISTIC: you use dataset condom, but you created previous1 in dataset condom&lt;STRONG&gt;1&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 07:55:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/All-observations-have-the-same-response-No-statistics-are/m-p/727683#M80317</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-03-19T07:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: All observations have the same response. No statistics are computed.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/All-observations-have-the-same-response-No-statistics-are/m-p/727721#M80318</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/374606"&gt;@u49589061&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;Second, I am currently running into problems with running the last two proc logistics statements. After I run the first proc logistic statement, it states that "All observations have the same response. No statistics are computed."&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Important debugging technique when you get this ERROR. Actually look at your data set with your own eyes and see what is happening. In this case, you will find that one of your variables has the same value for every observation. Then you have to fix this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also:&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;For Logistic Regression, do NOT create your own dummy variables. Just leave it as a character variable, and put the variable PREVIOUS in a CLASS statement. You gain nothing by converting it to numeric or creating dummy variables, but you do have to write extra code. Make your life easier, don't create your own dummy variables for Logistic Regression.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 12:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/All-observations-have-the-same-response-No-statistics-are/m-p/727721#M80318</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-03-19T12:00:24Z</dc:date>
    </item>
  </channel>
</rss>

