Weiwei Shi
2006-Oct-13 21:15 UTC
[R] correlation b/w a continuous variable and a categorical variable
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. thanks, weiwei -- Weiwei Shi, Ph.D Research Scientist GeneGO, Inc. "Did you always know?" "No, I did not. But I believed..." ---Matrix III
Achim Zeileis
2006-Oct-13 22:02 UTC
[R] correlation b/w a continuous variable and a categorical variable
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. >
Weiwei Shi
2006-Oct-13 22:17 UTC
[R] correlation b/w a continuous variable and a categorical variable
I see. i think the question is, I did not have a clear idea of the "correlation" between them (if I insist no transformation). Otherwise, for a binary variable case, maybe a simple "one-way t-test" serves the purpose if I defined such correlation or dependency as the group mean difference. thanks. On 10/13/06, Achim Zeileis <Achim.Zeileis at wu-wien.ac.at> wrote:> 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. > > >-- Weiwei Shi, Ph.D Research Scientist GeneGO, Inc. "Did you always know?" "No, I did not. But I believed..." ---Matrix III
Achim Zeileis
2006-Oct-13 22:37 UTC
[R] correlation b/w a continuous variable and a categorical variable
On Fri, 13 Oct 2006 18:17:10 -0400 Weiwei Shi wrote:> I see. > > i think the question is, I did not have a clear idea of the > "correlation" between them (if I insist no transformation). Otherwise, > for a binary variable case, maybe a simple "one-way t-test" serves the > purpose if I defined such correlation or dependency as the group mean > difference....another special case of the general framework I outlined below. But the man page and package vignette I already pointed you to, give you a much better explanation of this. Z> thanks. > > On 10/13/06, Achim Zeileis <Achim.Zeileis at wu-wien.ac.at> wrote: > > 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. > > > > > > > > -- > 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. >