Hi, I wanted to know how to compute the correlation ratio (eta) between two variables using R. Is there any function to compute the correlation ratio. Any help will be very much appreciated. Thanks, Suman [[alternative HTML version deleted]]
On Wed, 27 Jun 2007, suman Duvvuru wrote:> Hi, > > I wanted to know how to compute the correlation ratio (eta) between two > variables using R. Is there any function to compute the correlation ratio. > Any help will be very much appreciated.help.search("correlation") ?cancor ?lm --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k
Hi Bruce, correlation ratio (eta) is different from correlation coefficient (rho). While correlation coefficient captures only a linear relationship btw variables, correlation ratio captures both linear and non-linear relationships. It is the defined as the ratio of the variance between arrays to the total variance. Thanks, Suman On 6/27/07, Bruce Willy <croero@hotmail.com> wrote:> > hello > > try cor(x, y = NULL, use = "all.obs", > method = c("pearson", "kendall", "spearman")) > > in the R console, you can type "?cor" to get some help on a particular > function > and help.search("correlation") if you do know the keyword > > > Date: Wed, 27 Jun 2007 18:00:05 -0400 > > From: duvvuru.suman@gmail.com > > To: R-help@stat.math.ethz.ch > > Subject: [R] Correlation ratio > > > > Hi, > > > > I wanted to know how to compute the correlation ratio (eta) between two > > variables using R. Is there any function to compute the correlation > ratio. > > Any help will be very much appreciated. > > > > Thanks, > > Suman > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help@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. > > > ------------------------------ > Besoin d'un e-mail ? Créez gratuitement un compte Windows Live Hotmail et > bénéficiez de 2 Go de stockage ! Windows Live Hotmail<http://www.windowslive.fr/hotmail/default.asp> >[[alternative HTML version deleted]]
Suman, Try this: # some data example(aov) # the summary table anova(npk.aov) # extract sums of squares SS <- anova(npk.aov)$"Sum Sq" SS #[1] 343.2950000 189.2816667 8.4016667 95.2016667 21.2816667 33.1350000 0.4816667 185.2866667 # eta-squared for factor N #SS factor N/SS Total SS[2]/sum(SS) #[1] 0.2159850 # partial eta-squared for factor N # SS factor N/(SS Factor N + SS Residuals) SS[2]/(sum(SS[2],SS[8])) #[1] 0.5053328 Hope this helps, Scot suman Duvvuru wrote:> Hi Bruce, > correlation ratio (eta) is different from correlation coefficient (rho). > While correlation coefficient captures only a linear relationship btw > variables, correlation ratio captures both linear and non-linear > relationships. It is the defined as the ratio of the variance between > arrays to the total variance. > > Thanks, > Suman > > > On 6/27/07, Bruce Willy <croero at hotmail.com> wrote: > >> hello >> >> try cor(x, y = NULL, use = "all.obs", >> method = c("pearson", "kendall", "spearman")) >> >> in the R console, you can type "?cor" to get some help on a particular >> function >> and help.search("correlation") if you do know the keyword >> >> >>> Date: Wed, 27 Jun 2007 18:00:05 -0400 >>> From: duvvuru.suman at gmail.com >>> To: R-help at stat.math.ethz.ch >>> Subject: [R] Correlation ratio >>> >>> Hi, >>> >>> I wanted to know how to compute the correlation ratio (eta) between two >>> variables using R. Is there any function to compute the correlationratio. >>> >>> Any help will be very much appreciated. >>> >>> Thanks, >>> Suman >>> >>>-- Scot McNary smcnary at charm dot net