<?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: Sas create table in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sas-create-table/m-p/291809#M19903</link>
    <description>&lt;PRE&gt;
How do you get that COUNT variable. I also notice you want PI coefficient.


data have;
input ID     A1  A2  A3  A4;
cards;
1             1    1    1    0     
2             0    1    0   1  
3             1    1    1   1  
4             0    0    1   0  
5             1    1    0   0  
6             1    0    1   1  
7             1    0    1   1  
8             0    0    0   0  
9             0    1    1   1  
11            1    1    1   0  
12            1    1    1   1  
13            1    0    1   0  
14            0    1    1   1  
15            1    1    0   0  
16            1    1    1   0  
17            0    1    1   1  
18            1    1    1   0  
;
run;

data temp;
 set have(drop=id);
 array x{*} A:;
 length vname1 vname2 $ 40;
 do i=1 to dim(x);
  vname1=vname(x{i});
  value1=x{i};
  do j=i+1 to dim(x);
   vname2=vname(x{j});
   value2=x{j};
   output;
  end;
 end;
keep vname1 vname2 value1 value2;
run;
proc sort data=temp;
 by vname1 vname2 value1 value2;
run;
proc freq data=temp noprint;
 tables vname1*vname2/out=temp1 list;
run;
proc freq data=temp noprint;
 by vname1 vname2 ;
 table value1*value2/chisq;
 output out=temp2 phi;
run;
data want;
 merge temp1 temp2;
 by vname1 vname2;
run;


&lt;/PRE&gt;</description>
    <pubDate>Tue, 16 Aug 2016 03:25:06 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-08-16T03:25:06Z</dc:date>
    <item>
      <title>Sas create table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sas-create-table/m-p/291685#M19899</link>
      <description>&lt;P&gt;SAS Enterprise Guide 7.11&lt;/P&gt;&lt;P&gt;Hi, I have questions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I want to create a table which I want to create. but i don't know how to do. PLZ let me know &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;original dataset :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A1 &amp;nbsp;A2 &amp;nbsp;A3 &amp;nbsp;... &amp;nbsp;A91 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; An : disease name&lt;/P&gt;&lt;P&gt;-------------------------------------&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1:disease o&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0:disease x&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;910000 &amp;nbsp; 1 &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TABLE which i want to create :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;disease1 &amp;nbsp; disease2 &amp;nbsp; count &amp;nbsp; phi coefficient&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------&lt;/P&gt;&lt;P&gt;A1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.012&lt;/P&gt;&lt;P&gt;A1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.033&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;:&lt;/P&gt;&lt;P&gt;A1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A91 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.223&lt;/P&gt;&lt;P&gt;A2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 40 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.111&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;:&lt;/P&gt;&lt;P&gt;A2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A91 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 200 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.333&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;:&lt;/P&gt;&lt;P&gt;A90 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A91 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.445&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. I've already tried these proc steps.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;proc table;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;table A1*(A2-A91);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;output out=a / chisq;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i don't know next steps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;and i know i have to use 'proc tamplate step' but i don't know how to do. plz help me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 14:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sas-create-table/m-p/291685#M19899</guid>
      <dc:creator>PICKME</dc:creator>
      <dc:date>2016-08-15T14:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Sas create table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sas-create-table/m-p/291692#M19900</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think in your code you meant to say:&lt;/P&gt;
&lt;PRE&gt;proc freq data=&amp;lt;dataset&amp;gt;;
  tables A1*(A2-A91);
  output out=a / chisq;
run;&lt;/PRE&gt;
&lt;P&gt;Or something similar to that. &amp;nbsp;On a secondary note, proc template is used to create templates, be them style templates, graph templates or table templates. &amp;nbsp;You do not *need* to use them at all, although they are helpful to get output to look a certain way. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next up I would suggest you post test data as a datastep, follow this post:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;So we can run code against it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 14:25:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sas-create-table/m-p/291692#M19900</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-08-15T14:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sas create table</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sas-create-table/m-p/291809#M19903</link>
      <description>&lt;PRE&gt;
How do you get that COUNT variable. I also notice you want PI coefficient.


data have;
input ID     A1  A2  A3  A4;
cards;
1             1    1    1    0     
2             0    1    0   1  
3             1    1    1   1  
4             0    0    1   0  
5             1    1    0   0  
6             1    0    1   1  
7             1    0    1   1  
8             0    0    0   0  
9             0    1    1   1  
11            1    1    1   0  
12            1    1    1   1  
13            1    0    1   0  
14            0    1    1   1  
15            1    1    0   0  
16            1    1    1   0  
17            0    1    1   1  
18            1    1    1   0  
;
run;

data temp;
 set have(drop=id);
 array x{*} A:;
 length vname1 vname2 $ 40;
 do i=1 to dim(x);
  vname1=vname(x{i});
  value1=x{i};
  do j=i+1 to dim(x);
   vname2=vname(x{j});
   value2=x{j};
   output;
  end;
 end;
keep vname1 vname2 value1 value2;
run;
proc sort data=temp;
 by vname1 vname2 value1 value2;
run;
proc freq data=temp noprint;
 tables vname1*vname2/out=temp1 list;
run;
proc freq data=temp noprint;
 by vname1 vname2 ;
 table value1*value2/chisq;
 output out=temp2 phi;
run;
data want;
 merge temp1 temp2;
 by vname1 vname2;
run;


&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Aug 2016 03:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sas-create-table/m-p/291809#M19903</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-16T03:25:06Z</dc:date>
    </item>
  </channel>
</rss>

