<?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: Tabulating agreement matrix? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Tabulating-agreement-matrix/m-p/542271#M149824</link>
    <description>&lt;P&gt;&lt;STRONG&gt;proc distance&lt;/STRONG&gt; gets you close ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input subj $ (res1-res5) (:$1.);
datalines;
1 T F T T F 
2 T F F F T
3 F T F T T 
4 F F F F T
;

proc distance data=have out=want method=match shape=square;
id subj;
var nominal (res1-res5);
run;

proc print data=want noobs; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;                        subj     _1     _2     _3     _4

                         1      1.0    0.4    0.2    0.2
                         2      0.4    1.0    0.4    0.8
                         3      0.2    0.4    1.0    0.6
                         4      0.2    0.8    0.6    1.0
&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 Mar 2019 03:55:38 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2019-03-12T03:55:38Z</dc:date>
    <item>
      <title>Tabulating agreement matrix?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tabulating-agreement-matrix/m-p/542260#M149820</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have approximately 20 subjects and 30 questions (True or False responses). My goal is to tabulate a respondent-by-respondent matrix, in which each cell would have the number of identical responses per individual. Something like this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas1.PNG" style="width: 365px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27858i95F8E791AD8B548D/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas1.PNG" alt="sas1.PNG" /&gt;&lt;/span&gt;&lt;BR /&gt;While right now I have something like this, with respondents as rows and questions as columns:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas2.PNG" style="width: 368px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27859i708848BED25C0CD2/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas2.PNG" alt="sas2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was going to try and use if-then statements to calculate the agreeance between each combination of respondent, by transposing the data and doing something like "if var1=var2 then agreeance_12=1; else aggreance_12=0" but this would obviously take a very long time. I would appreciate anyone's help!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 01:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tabulating-agreement-matrix/m-p/542260#M149820</guid>
      <dc:creator>richart</dc:creator>
      <dc:date>2019-03-12T01:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Tabulating agreement matrix?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tabulating-agreement-matrix/m-p/542271#M149824</link>
      <description>&lt;P&gt;&lt;STRONG&gt;proc distance&lt;/STRONG&gt; gets you close ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input subj $ (res1-res5) (:$1.);
datalines;
1 T F T T F 
2 T F F F T
3 F T F T T 
4 F F F F T
;

proc distance data=have out=want method=match shape=square;
id subj;
var nominal (res1-res5);
run;

proc print data=want noobs; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;                        subj     _1     _2     _3     _4

                         1      1.0    0.4    0.2    0.2
                         2      0.4    1.0    0.4    0.8
                         3      0.2    0.4    1.0    0.6
                         4      0.2    0.8    0.6    1.0
&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2019 03:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tabulating-agreement-matrix/m-p/542271#M149824</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-03-12T03:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Tabulating agreement matrix?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tabulating-agreement-matrix/m-p/542357#M149863</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input subj $ (res1-res5) (:$1.);
datalines;
1 T F T T F 
2 T F F F T
3 F T F T T 
4 F F F F T
;
data temp;
 set have;
 array x{*} res:;
 do i=1 to dim(x);
   do j=i+1 to dim(x);
    if x{i}=x{j} then do;a=vname(x{i});b=vname(x{j});output; end;
   end;
 end;
keep a b;
run;
proc freq data=temp noprint;
table a*b/out=temp1;
run;
data temp2(index=(a));
 set temp1;
 output;
 temp=a;a=b;b=temp;output;
 drop temp;
run;

proc transpose data=temp2 out=temp3(drop=_:);
by a;
id b;
var count;
run;
proc sql noprint;
select a into : list separated by ' ' from temp3;
quit;
data temp4;
 retain a &amp;amp;list;
 set temp3;
run;
proc stdize data=temp4 out=want missing=0 reponly;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Assuming I understand your question .&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 13:09:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tabulating-agreement-matrix/m-p/542357#M149863</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-03-12T13:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Tabulating agreement matrix?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tabulating-agreement-matrix/m-p/542472#M149892</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240551"&gt;@richart&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have approximately 20 subjects and 30 questions (True or False responses). My goal is to tabulate a respondent-by-respondent matrix, in which each cell would have the number of identical responses per individual. Something like this:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas1.PNG" style="width: 365px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27858i95F8E791AD8B548D/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas1.PNG" alt="sas1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;!&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So what does 1,2, 3 as column header or the 13 mean in first row? I am really not sure what you are actually counting.&amp;nbsp;Define "identical response per individual".&amp;nbsp;Perhaps if you provided a small example such as a data step with 3 individuals, 4 questions and what the result matrix looks like.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 15:53:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tabulating-agreement-matrix/m-p/542472#M149892</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-12T15:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Tabulating agreement matrix?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tabulating-agreement-matrix/m-p/542526#M149913</link>
      <description>&lt;P&gt;This works perfectly as well. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 17:52:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tabulating-agreement-matrix/m-p/542526#M149913</guid>
      <dc:creator>richart</dc:creator>
      <dc:date>2019-03-12T17:52:32Z</dc:date>
    </item>
  </channel>
</rss>

