<?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: Binary Data and Correlations in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33259#M19818</link>
    <description>Hi Mark,&lt;BR /&gt;&lt;BR /&gt;Thank you for the script. I am actually away thus week from work but I will certainly be trying it on Monday.&lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;BR /&gt;</description>
    <pubDate>Thu, 08 Dec 2016 05:46:42 GMT</pubDate>
    <dc:creator>natalie_</dc:creator>
    <dc:date>2016-12-08T05:46:42Z</dc:date>
    <item>
      <title>Binary Data and Correlations</title>
      <link>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/31110#M19690</link>
      <description>&lt;P&gt;The other day, I was asking about binary data and correlations. &amp;nbsp;I had been using the multivariate correlation tool which outputs the correlation coefficients into a matrix. &amp;nbsp;However, from further research, I don't think using this correlation tool is meaningful for categorical data because it uses the Pearson Product Moment Correlation. &amp;nbsp;In my data, each value is a 0 or 1 (pass or fail) which is binary data. &amp;nbsp;I have read that I should use the Phi Coefficient to calculate the&amp;nbsp;correlation for binary numbers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) &amp;nbsp;Can I interpret the coefficient the same way as the PPMC? &amp;nbsp;I know that the closer it is to +1, there is a strong positive correlation. &amp;nbsp;If I square this coefficient, can I still use it to calculate coefficient of determination?&lt;/P&gt;&lt;P&gt;2) &amp;nbsp;Can I calculate this using JMP? &amp;nbsp;Is there a way to change the correlation matrix so it calculares this phi coefficient instead of the PPMC?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, Natalie&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 19:35:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/31110#M19690</guid>
      <dc:creator>natalie_</dc:creator>
      <dc:date>2016-12-02T19:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Data and Correlations</title>
      <link>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/31111#M19691</link>
      <description>&lt;P&gt;Categorical data is different from continuous data. There generally are analogous measures and methods, though. For example, instead of talking about correlation as we would with continuous variables, we talk about &lt;EM&gt;association&lt;/EM&gt;&amp;nbsp;or &lt;EM&gt;agreement&lt;/EM&gt; with categorical variables. There are many such measures and JMP provides most of the important and popular&amp;nbsp;measures.&lt;/P&gt;
&lt;P&gt;The appropriate method and measure depend on the nature of the categories:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;number of levels (2, 3, or more)&lt;/LI&gt;
&lt;LI&gt;modeling type (nominal or ordinal)&lt;/LI&gt;
&lt;LI&gt;whether the same levels are used for both variables&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;It sounds like you might be interested in the &lt;STRONG&gt;agreement&lt;/STRONG&gt; between two&amp;nbsp;variables that capture the same &lt;STRONG&gt;nominal&lt;/STRONG&gt;, &lt;STRONG&gt;binary&lt;/STRONG&gt; levels. You can use the &lt;STRONG&gt;Analyze&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;Fit Y by X&lt;/STRONG&gt; command to launch the &lt;STRONG&gt;Contingency&lt;/STRONG&gt; platform. The platform menu includes a command to obtain the agreement and another command to obtain the association measures.&lt;/P&gt;
&lt;P&gt;Remember that you can select &lt;STRONG&gt;Tools&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;Help&lt;/STRONG&gt; and then click on a report to go directly to the specific Help for that information.&lt;/P&gt;
&lt;P&gt;Generally these measures are scaled like correlation so the interpretation is the same.&lt;/P&gt;
&lt;P&gt;I do not know why you selected the Phi measure. We can talk about that, too.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 19:52:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/31111#M19691</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2016-12-02T19:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Data and Correlations</title>
      <link>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/31119#M19698</link>
      <description>&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for this! &amp;nbsp;I tried the Contigency Analysis on two variabes. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My RSquare (U) is 0.9208- so if I understand this correctly, these two variables predict eachother's response since RSquare is fairly close to +1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My&amp;nbsp;p-value is &amp;lt;.0001. &amp;nbsp;Since these two variables are binary, either pass or fail (1 or 0):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ho: The result of one variable has no affect on the seond.&lt;/P&gt;&lt;P&gt;Ha: &amp;nbsp;The result of one variable has an effect on the second.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since my p-value is less than 0.05, I reject the null hypothesis in favour of the alternate hypothesis, correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 60 different binary variables. &amp;nbsp;Is it possible to get the RSquare value into a matrix or data table? &amp;nbsp;This would be similar to the multivariate correlation matrix, but a data table works well, too. &amp;nbsp;I don't need to have all these different reports for what I am working on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was just researching the Phi Coefficient. &amp;nbsp;It says that it quantifies the association between two binary variables. &amp;nbsp;Is it not possible to make this calculation in JMP without writing a script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 21:06:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/31119#M19698</guid>
      <dc:creator>natalie_</dc:creator>
      <dc:date>2016-12-02T21:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Data and Correlations</title>
      <link>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/31120#M19699</link>
      <description>&lt;P&gt;The R Square (U) is based on likelihood but it is used exactly the same as R Square with continuous variables.&lt;/P&gt;
&lt;P&gt;Yes, your interpretatoin of the p-value is correct.&lt;/P&gt;
&lt;P&gt;A script could be written to launch the Contingency platform with each pair, collect the R Square (U) statistic, and report them in a custom window.&lt;/P&gt;
&lt;P&gt;As to the Phi measure, you might instead research the ones that JMP offers to see if they might be useful. Again, since all of your variables measure 0 or 1, agreement might be a better measure than association.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 21:28:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/31120#M19699</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2016-12-02T21:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Data and Correlations</title>
      <link>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/31126#M19705</link>
      <description>&lt;P&gt;Thank you very much for your reply! &amp;nbsp;I am familiar getting pretty familiar with JSL, but I am not sure how I could collect the RSquare value. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 22:05:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/31126#M19705</guid>
      <dc:creator>natalie_</dc:creator>
      <dc:date>2016-12-02T22:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Data and Correlations</title>
      <link>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/31138#M19707</link>
      <description>&lt;P&gt;Here is a script that collects &lt;STRONG&gt;RSquare (U)&lt;/STRONG&gt; and &lt;STRONG&gt;Kappa&lt;/STRONG&gt; from all combinations of your binary columns:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt# = Current Data Table();
If( Is Empty( dt# ),
	Throw( "Data table missing" )
);

// user choices.
dlg# = Column Dialog(
	Title( "Binary Agreement" ),
	yCol# = Col List( "Binary Columns",
		Min Col( 2 )
	),
	"Select columns for agreement"
);

// check if user decides to quit.
If( dlg#["Button"] == -1,
	Throw( "User cancelled" );
);

// process information returned from dialog.
Remove From( dlg# ); Eval List( dlg# );

n cols# = N Items( yCol# );
r sqr u# = agree# = Identity( n cols# );
measure# = List();
For( col1# = 1, col1# &amp;lt; n cols#, col1#++,
	Insert Into( measure#, yCol#[col1#] &amp;lt;&amp;lt; Get Name);
	For( col2# = 2, col2# &amp;lt;= n cols#, col2#++,
		ct# = dt# &amp;lt;&amp;lt; Contingency(
			Y( yCol#[col1#] ),
			X( yCol#[col2#] ),
			Contingency Table( 0 ),
			Mosaic Plot( 0 ),
			Tests( 1 ),
			Agreement Statistic( 1 ),
			Invisible
		);
		ctr# = ct# &amp;lt;&amp;lt; Report;
		r sqr u#[col1#,col2#] = r sqr u#[col2#,col1#] = ctr#["Tests"][TableBox(1)][NumberColBox(4)][1];
		agree#[col1#,col2#]   = agree#[col2#,col1#]   = ctr#["Kappa Coefficient"][TableBox(1)][NumberColBox(1)][1];
		ct# &amp;lt;&amp;lt; Close Window;
	);
);
Insert Into( measure#, yCol#[col1#] &amp;lt;&amp;lt; Get Name );

New Window( "Binary Agreement",
	Outline Box( "RSquare (U)",
		tb1 = Table Box(
			String Col Box( "Measure", measure# )
		)
	),
	Outline Box( "Kappa Coefficient",
		tb2 = Table Box(
			String Col Box( "Measure", measure# )
		)
	)
);

For( col# = 1, col# &amp;lt;= n cols#, col#++,
	tb1 &amp;lt;&amp;lt; Append(
		Number Col Box( measure#[col#], r sqr u#[0,col#], &amp;lt;&amp;lt; Set Format( 7, 4 ) )
	);
	tb2 &amp;lt;&amp;lt; Append(
		Number Col Box( measure#[col#], agree#[0,col#], &amp;lt;&amp;lt; Set Format( 7, 4 ) )
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 03 Dec 2016 15:35:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/31138#M19707</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2016-12-03T15:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Data and Correlations</title>
      <link>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33191#M19793</link>
      <description>&lt;P&gt;Did my script work for you? Did you have any difficulty?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2016 18:43:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33191#M19793</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2016-12-07T18:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Data and Correlations</title>
      <link>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33259#M19818</link>
      <description>Hi Mark,&lt;BR /&gt;&lt;BR /&gt;Thank you for the script. I am actually away thus week from work but I will certainly be trying it on Monday.&lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Dec 2016 05:46:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33259#M19818</guid>
      <dc:creator>natalie_</dc:creator>
      <dc:date>2016-12-08T05:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Data and Correlations</title>
      <link>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33577#M19924</link>
      <description>&lt;P&gt;Hi again Mark,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for this script; it's really great code! It is running well, and I spent some time learnig how you wrote it (I think I learned some more about scripting, too)!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your code,&amp;nbsp;I understand how you got the kappa value or R Square(U) from the report. &amp;nbsp;If I manually do a Fit Y by X, I just don't see where to find the kappa coefficient. &amp;nbsp;I would like to learn more about this coefficient and how it is calculated. &amp;nbsp;Some of my data might have an entire column full of 1s, and when it is included in the contingency report, the report isn't made. &amp;nbsp;From the log and from my debugging, I think this is because the kappa coefficient isn't being calculate or can't be. &amp;nbsp;Why is this?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2016 21:53:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33577#M19924</guid>
      <dc:creator>natalie_</dc:creator>
      <dc:date>2016-12-12T21:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Data and Correlations</title>
      <link>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33620#M19940</link>
      <description>&lt;P&gt;Okay, so I found where to find the Kappa Coefficient; it's under the "Agreement Statistic" table. &amp;nbsp;The "Agreement Statistic" table only appears when both X and Y variables have the same levels. &amp;nbsp;What does that mean? &amp;nbsp;Is there a way to check for this?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2016 14:57:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33620#M19940</guid>
      <dc:creator>natalie_</dc:creator>
      <dc:date>2016-12-13T14:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Data and Correlations</title>
      <link>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33648#M19955</link>
      <description>&lt;P&gt;Ha, great question!&lt;/P&gt;
&lt;P&gt;OK, the answer is that there must be variation to learn. If you always get the same answer no matter what the conditions&amp;nbsp;are, then you can't determine what causes it to vary. The statistics can't provide answers that aren't there.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 01:55:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33648#M19955</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2016-12-14T01:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Data and Correlations</title>
      <link>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33649#M19956</link>
      <description>&lt;P&gt;More great questions.&lt;/P&gt;
&lt;P&gt;It's really just "apples to apples" or "apples to oranges." Also, it is the difference between continuous and categorical data.&lt;/P&gt;
&lt;P&gt;If you have a classification&amp;nbsp;of intelligence and another classification of monetary assets, you can use Contingency to see if these variables are associated. (Analogous to correlated with continuous variables.) On the other hand if you had two classifications of intelligence, you could assess the association but you could explore a stricter relationship: agreement. What is the proportion&amp;nbsp;of times both classifications agreed?&lt;/P&gt;
&lt;P&gt;We measure the strength of association with the odds ratio. We measure the strength of agreement&amp;nbsp;with Kappa.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 02:01:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33649#M19956</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2016-12-14T02:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Binary Data and Correlations</title>
      <link>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33657#M19964</link>
      <description>&lt;P&gt;Thanks again Mark! &amp;nbsp;Your help has been great :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 15:15:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Binary-Data-and-Correlations/m-p/33657#M19964</guid>
      <dc:creator>natalie_</dc:creator>
      <dc:date>2016-12-14T15:15:22Z</dc:date>
    </item>
  </channel>
</rss>

