[R] correlation b/w a continuous variable and a categorical variable

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Sat Oct 14 00:02:49 CEST 2006


On Fri, 13 Oct 2006 17:15:45 -0400 Weiwei Shi wrote:

> Dear Listers:
> 
> I happen to have this question in mind, is there a way to evaluate the
> "correlation" between
> a continuous variable and a categorical variable (without discretizing
> the former)? My intuitive is using lda by considering the latter as
> response variable but not sure.

It depends what exactly you mean by "evaluate correlation". If you want
to test independence of two variables X and Y against some form of
association, you can generally use statistics based on
  sum h(Y) * g(X)
where h() and g() are suitable transformations of X and Y. Special
cases of this framework are tests for correlation of continuous
variables and Chi-squared type statistics for categorical variables.
This approach is implemented in the package "coin", see
independence_test() and the package vignette.

hth,
Z

> thanks,
> 
> weiwei
> 
> -- 
> Weiwei Shi, Ph.D
> Research Scientist
> GeneGO, Inc.
> 
> "Did you always know?"
> "No, I did not. But I believed..."
> ---Matrix III
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html and provide commented,
> minimal, self-contained, reproducible code.
>



More information about the R-help mailing list