<?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: variable Logit_Dia not returning any value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914456#M360344</link>
    <description>&lt;P&gt;Sorry, I should have included the entire code.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Feb 2024 01:19:42 GMT</pubDate>
    <dc:creator>datanovice23</dc:creator>
    <dc:date>2024-02-05T01:19:42Z</dc:date>
    <item>
      <title>variable Logit_Dia not returning any value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914451#M360340</link>
      <description>&lt;P&gt;Hello, I am working in SAS Studio analyzing the HEART dataset. The below is my code. The boldened text is the problem code. The&amp;nbsp;&lt;STRONG&gt;Logit_Dia &lt;/STRONG&gt;variable is not returning any data back. Is there anything obvious I am missing here?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc means data=out3 nway;&lt;/P&gt;&lt;P&gt;class mrw_group;&lt;/P&gt;&lt;P&gt;var mrw;&lt;/P&gt;&lt;P&gt;output out=Out4a Mean=CHD_Mean mean(mrw)=MRW_Mean;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc means data=out3 nway;&lt;/P&gt;&lt;P&gt;class height_group;&lt;/P&gt;&lt;P&gt;var height;&lt;/P&gt;&lt;P&gt;output out=Out4b Mean=CHD_Mean mean(height)=height_Mean;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc means data=out3 nway;&lt;/P&gt;&lt;P&gt;class weight_group;&lt;/P&gt;&lt;P&gt;var weight;&lt;/P&gt;&lt;P&gt;output out=Out4c Mean=CHD_Mean mean(weight)=weight_Mean;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data out5a;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set out4a;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Logit_Dia = log( CHD_Mean / (1 - CHD_Mean) );&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data out5b;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set out4b;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Logit_Dia = log( CHD_Mean / (1 - CHD_Mean) );&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data out5c;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set out4c;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Logit_Dia = log( CHD_Mean / (1 - CHD_Mean) );&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 00:35:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914451#M360340</guid>
      <dc:creator>datanovice23</dc:creator>
      <dc:date>2024-02-05T00:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: variable Logit_Dia not returning any value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914452#M360341</link>
      <description>&lt;P&gt;The main things missing are&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the definition&amp;nbsp;of the input dataset, OUT3,&lt;/LI&gt;
&lt;LI&gt;the definition of the three class variables you are using&lt;/LI&gt;
&lt;LI&gt;The SAS log so we can see how many observations each of the steps read in from their input datasets and how many observations they wrote out into their output datasets.&lt;/LI&gt;
&lt;LI&gt;And whether there were any errors or notes written to the log.&lt;/LI&gt;
&lt;/UL&gt;
&lt;PRE&gt;16   proc means data=sashelp.heart nway;
17     var mrw;
18     output out=mrw Mean=CHD_Mean ;
19   run;

NOTE: There were 5209 observations read from the data set SASHELP.HEART.
NOTE: The data set WORK.MRW has 1 observations and 3 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


20
21   data mrw_logit;
22     set mrw;
23     Logit_Dia = log( CHD_Mean / (1 - CHD_Mean) );
24   run;

NOTE: Invalid argument to function LOG(-1.008406362) at line 23 column 15.
_TYPE_=0 _FREQ_=5209 CHD_Mean=119.95752451 Logit_Dia=. _ERROR_=1 _N_=1
NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to
      missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      1 at 23:15
NOTE: There were 1 observations read from the data set WORK.MRW.
NOTE: The data set WORK.MRW_LOGIT has 1 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Since the MEAN of most of those variables is going to be larger than 1 you are trying to take the LOG() of a negative number.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 00:52:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914452#M360341</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-02-05T00:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: variable Logit_Dia not returning any value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914453#M360342</link>
      <description>&lt;P&gt;After mocking up your source table OUT3 looking into your code and running it shows two issues.&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data out3;
  set sashelp.heart;
  mrw_group=ceil(mrw/10);
  height_group=ceil(height/5);
  weight_group=ceil(weight/10);
run;

proc means data=out3 nway;
  class mrw_group;
  var mrw;
  output out=Out4a Mean=CHD_Mean mean(mrw)=MRW_Mean;
run;

proc means data=out3 nway;
  class height_group;
  var height;
  output out=Out4b Mean=CHD_Mean mean(height)=height_Mean;
run;

proc means data=out3 nway;
  class weight_group;
  var weight;
  output out=Out4c Mean=CHD_Mean mean(weight)=weight_Mean;
run;

data out5a;
  set out4a;
  Logit_Dia = log( CHD_Mean / (1 - CHD_Mean) );
run;

data out5b;
  set out4b;
  Logit_Dia = log( CHD_Mean / (1 - CHD_Mean) );
run;

data out5c;
  set out4c;
  Logit_Dia = log( CHD_Mean / (1 - CHD_Mean) );
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&lt;STRONG&gt;Issue 1&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;It appears that after copy/paste of your data steps you missed to also change the variable names so they match the ones in the input table from the set statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Issue 2&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If you look into the SAS log you will see:&amp;nbsp; &lt;FONT face="courier new,courier"&gt;NOTE: Invalid argument to function LOG(-1.015151515) at line&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Your expression creates a negative value which is not suitable for the log() function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 00:53:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914453#M360342</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-02-05T00:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: variable Logit_Dia not returning any value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914455#M360343</link>
      <description>&lt;P&gt;Sorry, I should have given you the entire code. It is attached now.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 01:18:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914455#M360343</guid>
      <dc:creator>datanovice23</dc:creator>
      <dc:date>2024-02-05T01:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: variable Logit_Dia not returning any value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914456#M360344</link>
      <description>&lt;P&gt;Sorry, I should have included the entire code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 01:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914456#M360344</guid>
      <dc:creator>datanovice23</dc:creator>
      <dc:date>2024-02-05T01:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: variable Logit_Dia not returning any value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914458#M360345</link>
      <description>&lt;P&gt;We don't have access to your library&amp;nbsp;libname heartlib "/home/u63742108/heartlib"; and the table in there is already a modified version of sashelp.heart&lt;/P&gt;
&lt;P&gt;Anyway: I believe the issues identified are what you need to address. Run your code step by step, check the SAS log for any issues and fix the step until working properly before you test the next one.&lt;/P&gt;
&lt;P&gt;What's also sometimes worth doing: Disconnect/reconnect to your SAS server so that a new SAS workspace session gets created and not some "leftover" from an earlier run in the same session impacts your current run.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 01:31:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914458#M360345</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-02-05T01:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: variable Logit_Dia not returning any value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914459#M360346</link>
      <description>Thanks Patrick. I figured out what was wrong. Evidently, I did not define the variable correctly in the proc means statement.</description>
      <pubDate>Mon, 05 Feb 2024 02:15:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/variable-Logit-Dia-not-returning-any-value/m-p/914459#M360346</guid>
      <dc:creator>datanovice23</dc:creator>
      <dc:date>2024-02-05T02:15:37Z</dc:date>
    </item>
  </channel>
</rss>

