On Saturday 20 June 2009 04:36:55 pm Marc Schwartz wrote:
> On Jun 20, 2009, at 2:05 PM, Jason Morgan wrote:
> > On 2009.06.19 14:04:59, Michael wrote:
> >> Hi all,
> >>
> >> In a data-frame, I have two columns of data that are categorical.
> >>
> >> How do I form some sort of measure of correlation between these two
> >> columns?
> >>
> >> For numerical data, I just need to regress one to the other, or do
> >> some pairs plot.
> >>
> >> But for categorical data, how do I find and/or visualize correlation
> >> between the two columns of data?
> >
> > As Dylan mentioned, using crosstabs may be the easiest way. Also, a
> > simple correlation between the two variables may be informative. If
> > each variable is ordinal, you can use Kendall's tau-b (square table)
> > or tau-c (rectangular table). The former you can calculate with ?cor
> > (set method="kendall"), the latter you may have to hack something
> > together yourself, there is code on the Internet to do this. If the
> > data are nominal, then a simple chi-squared test (large-n) or Fisher's
> > exact test (small-n) may be more appropriate. There are rules about
> > which to use when one variable is ordinal and one is nominal, but I
> > don't have my notes in front of me. Maybe someone else can provide
> > more assistance (and correct me if I'm wrong :).
>
> I would be cautious in recommending the Fisher Exact Test based upon
> small samples sizes, as the FET has been shown to be overly
> conservative. 
> 
> . . .
There are other ways of regarding the FET.  Since it is precisely what it says 
- an exact test - you can argue that you should avoid carrying over any 
conclusions drawn about the small population the test was applied to and 
employing them in a broader context.  In so far as the test is concerned, the 
"sample" data and the contingency table it is arrayed in are the entire 
universe.  In that sense, the FET can't be "conservative" or "liberal."  It 
isn't actually a hypothesis test and should not be thought of as one or used 
in the place of one.  
>
JDougherty


	[[alternative HTML version deleted]]


