<?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 - How to Pull Specific Statistical Values? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278359#M58879</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS﻿&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for providing this sample code, I think it sould seem as below;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Ods Graphics On; 
Ods Output ResponseProfile=Res_ Association=Roc_ ParameterEstimates=Err_;

PROC LOGISTIC DATA=Want NameLen=32  PLOTS(ONLY)=ALL;
BY Group;
MODEL Target (Event = '1')=X / LINK=LOGIT;
RUN;

Ods Output Close; 
Ods Graphics Off;


Data Err2_ (Keep=Group Variable StdErr Dataset Rename=(StdErr=Variable2));
Length Dataset $ 32;
Set Err_;
Where Variable="X";
If Variable="X" then Variable="StdErr_";
Dataset="X";
Run;

Data Roc2_(Keep=Dataset Group Label2 nValue2  Rename=(nValue2=Variable2 Label2=Variable));
Length Dataset $ 32;
Set Roc_;
IF Label2="Somers' D" Or Label2="c";
If Label2="c" then Label2="Roc_";
If Label2="Somers' D" then Label2="Gini_";
Dataset="X";
Run;

PROC SQL;
Create Table Append_ As 
Select * From Roc2_
Outer Union Corr 
Select * From Err2_;
QUIT;

PROC SORT Data=Append_;
By Group;
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, when I first put my sample code, I didn't face an error but I re-wrote my previous sample code in my Pc,and now, I'm getting following errors, do you have an idea?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: File WORK.ERR_VARIABLE2.DATA does not exist.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: File WORK.ROC_VARIABLE2.DATA does not exist.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 18 Jun 2016 11:03:35 GMT</pubDate>
    <dc:creator>ertr</dc:creator>
    <dc:date>2016-06-18T11:03:35Z</dc:date>
    <item>
      <title>Proc Logistic - How to Pull Specific Statistical Values?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278187#M58842</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’m trying to pull “Stand Error”, “Gini” and “Roc” Values for more than one variable by using PROC LOGISTIC. Actually, I could pull them by the help of following code. At this point, I would like to ask that is there any method to pull this values without using much data steps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My sample code as below;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Have;
Length Target 8 Variable2 8 Variable3 8 Variable4 8 ;
Infile Datalines Missover;
Input Target Variable2 Variable3 Variable4 ;
Datalines;
0 -0.435409602 0.1111702173 -0.375361259
0 -0.435409602 0.9767642068 -0.375361259
1 -0.435409602 0.9767642068 -0.375361259
0 -0.435409602 0.9767642068 -0.375361259
0  0.8432328141 0.9767642068 -0.566274869
1 -0.435409602 0.9767642068 0.5257570782
0 -0.202340531 0 0.5257570782
0 -0.435409602 0 0.5257570782
1 0.3610487663 -1.119484453 0.5257570782
1 0 0 0.1876969043
0 -0.435409602 -0.82913977 -0.566274869
0 -0.435409602 -0.82913977 0.1876969043
1 0.3610487663 0.9767642068 -0.199600942
0 0.8432328141 0 -0.199600942
0 -0.202340531 0.9767642068 -0.375361259
;
Run;

%Macro Fake_Table;
Data Result_Append;
Length Dataset $ 32 Variable $ 9 Variable2 8;
Run;
Proc Sql; Delete From Result_Append;
%Mend Fake_Table;


%Macro Test(Var);

Ods Graphics On; 
Ods Output ResponseProfile=Res_&amp;amp;Var. Association=Roc_&amp;amp;Var. ParameterEstimates=Err_&amp;amp;Var.;
PROC LOGISTIC DATA=Have NameLen=32 PLOTS(ONLY)=ALL;
MODEL Target (Event = '1')=&amp;amp;Var. /SELECTION=NONE LINK=LOGIT;
RUN;
QUIT;

Data Err2_&amp;amp;Var.(Keep=Variable StdErr Dataset Rename=(StdErr=Variable2));
Length Dataset $ 32;
Set Err_&amp;amp;Var.;
Where Variable="&amp;amp;Var.";
If Variable="&amp;amp;Var." then Variable="StdErr_";
Dataset="&amp;amp;Var.";
Run;

Data Roc2_&amp;amp;Var.(Keep=Label2 nValue2 Dataset Rename=(nValue2=Variable2 Label2=Variable));
Length Dataset $ 32;
Set Roc_&amp;amp;Var.;
IF Label2="Somers' D" Or Label2="c";
If Label2="c" then Label2="Roc_";
If Label2="Somers' D" then Label2="Gini_";
Dataset="&amp;amp;Var.";
Run;

PROC SQL;
Create Table Append_&amp;amp;Var. As 
Select * From Roc2_&amp;amp;Var.
Outer Union Corr 
Select * From Err2_&amp;amp;Var.;
QUIT;

PROC APPEND Base=Result_Append Data=Append_&amp;amp;Var.;
Run;
 
Ods Output Close; 
Ods Graphics Off;

%Mend Test;
%Let Variable=Variable2 Variable3 Variable4;
%Macro Test_Loop;
%let i=1;
%do %while(%scan(&amp;amp;Variable.,&amp;amp;i.,%str( ))~=);
%Test(%scan(&amp;amp;Variable.,&amp;amp;i.,%str( )));
%let i=&amp;amp;i.+1;
%end;
%mend;



%Fake_Table;
%Test_Loop;



&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result_Append gives my desired output,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2016 13:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278187#M58842</guid>
      <dc:creator>ertr</dc:creator>
      <dc:date>2016-06-17T13:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Logistic - How to Pull Specific Statistical Values?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278196#M58844</link>
      <description>&lt;P&gt;I think your analysis will be cleaner and simpler if you convert the data from "Wide form" to "long form." That will enable you to use a BY statement, rather than a macro loop, to repeat the analysis for each&amp;nbsp;model that has a single independent variable. &amp;nbsp;For example, try modifying something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Want;
set Have;
Group=1; X=Variable2; output;
Group=2; X=Variable3; output;
Group=3; X=Variable4; output;
drop Variable2-Variable4;
run;

proc sort data=Want; by Group; run;

PROC LOGISTIC DATA=Want NameLen=32  ...;
BY Group;
MODEL Target (Event = '1')=X / LINK=LOGIT;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jun 2016 14:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278196#M58844</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-06-17T14:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Logistic - How to Pull Specific Statistical Values?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278346#M58875</link>
      <description>&lt;PRE&gt;
ods output is a good way to go, also check some output option like :

PROC LOGISTIC DATA=sashelp.class NameLen=32 ;
MODEL sex(Event = 'F')=age height  / LINK=LOGIT outroc=roc influence;
RUN;


&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Jun 2016 08:52:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278346#M58875</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-18T08:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Logistic - How to Pull Specific Statistical Values?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278359#M58879</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS﻿&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for providing this sample code, I think it sould seem as below;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Ods Graphics On; 
Ods Output ResponseProfile=Res_ Association=Roc_ ParameterEstimates=Err_;

PROC LOGISTIC DATA=Want NameLen=32  PLOTS(ONLY)=ALL;
BY Group;
MODEL Target (Event = '1')=X / LINK=LOGIT;
RUN;

Ods Output Close; 
Ods Graphics Off;


Data Err2_ (Keep=Group Variable StdErr Dataset Rename=(StdErr=Variable2));
Length Dataset $ 32;
Set Err_;
Where Variable="X";
If Variable="X" then Variable="StdErr_";
Dataset="X";
Run;

Data Roc2_(Keep=Dataset Group Label2 nValue2  Rename=(nValue2=Variable2 Label2=Variable));
Length Dataset $ 32;
Set Roc_;
IF Label2="Somers' D" Or Label2="c";
If Label2="c" then Label2="Roc_";
If Label2="Somers' D" then Label2="Gini_";
Dataset="X";
Run;

PROC SQL;
Create Table Append_ As 
Select * From Roc2_
Outer Union Corr 
Select * From Err2_;
QUIT;

PROC SORT Data=Append_;
By Group;
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, when I first put my sample code, I didn't face an error but I re-wrote my previous sample code in my Pc,and now, I'm getting following errors, do you have an idea?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: File WORK.ERR_VARIABLE2.DATA does not exist.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: File WORK.ROC_VARIABLE2.DATA does not exist.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jun 2016 11:03:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278359#M58879</guid>
      <dc:creator>ertr</dc:creator>
      <dc:date>2016-06-18T11:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Logistic - How to Pull Specific Statistical Values?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278360#M58880</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you but it sounds a little bit complicated. I just don't get which columns represents what?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jun 2016 11:07:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278360#M58880</guid>
      <dc:creator>ertr</dc:creator>
      <dc:date>2016-06-18T11:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Logistic - How to Pull Specific Statistical Values?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278361#M58881</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Regarding the&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ERROR: File WORK.ERR_VARIABLE2.DATA does not exist.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You must have code (not shown here) that is referencing that data set name. On one computer you were accessing&amp;nbsp;a stale copy that was created earlier during development. Find out the new name of the data set that contains that info.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jun 2016 11:18:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278361#M58881</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-06-18T11:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Logistic - How to Pull Specific Statistical Values?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278373#M58882</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS﻿&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is little bir interesting, when I wrote the following code, Variable3 and Variable4 dataset is created, Variable2 is not created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Macro Test(Var);
 
Ods Graphics On; 
Ods Output ResponseProfile=Res_&amp;amp;Var. Association=Roc_&amp;amp;Var. ParameterEstimates=Err_&amp;amp;Var.;
PROC LOGISTIC DATA=Have NameLen=32 PLOTS(ONLY)=ALL;
MODEL Target (Event = '1')=&amp;amp;Var. /SELECTION=NONE LINK=LOGIT;
RUN;
QUIT;
 
%Mend Test;
 
%Macro Test_Loop;
%let i=1;
%do %while(%scan(&amp;amp;Variable.,&amp;amp;i.,%str( ))~=);
%Test(%scan(&amp;amp;Variable.,&amp;amp;i.,%str( )));
%let i=&amp;amp;i.+1;
%end;
%mend;
%Let Variable=Variable2 Variable3 Variable4;
 
%Test_Loop;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Jun 2016 13:40:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278373#M58882</guid>
      <dc:creator>ertr</dc:creator>
      <dc:date>2016-06-18T13:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Logistic - How to Pull Specific Statistical Values?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278854#M58954</link>
      <description>&lt;P&gt;Hi again&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS﻿&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you give me a brief information about how can I solve my following errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just don't understand.&amp;nbsp;Macro resolves Variable3 and Variable4 but it doesn't resolve the Variable2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: File WORK.ERR_VARIABLE2.DATA does not exist.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: File WORK.ROC_VARIABLE2.DATA does not exist.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;How can I solve the foregoing erros?&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2016 22:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Logistic-How-to-Pull-Specific-Statistical-Values/m-p/278854#M58954</guid>
      <dc:creator>ertr</dc:creator>
      <dc:date>2016-06-20T22:07:44Z</dc:date>
    </item>
  </channel>
</rss>

