Dear R-users.... please ignore my most recent posting.. Found the solution.. Thanks to David Winsemius..
Thanks, Santosh On Tue, Jul 14, 2009 at 9:14 PM, Santosh <santosh2...@gmail.com> wrote: > Dear R-users.. > > I hope the following scenario is more explanatory of my question.. > > Continuous variables: AGE, WEIGHT, HEIGHT > Categorical variables: Group, Sex, Race > I would like to find a correlation between WEIGHT and AGE, grouped by > "Group","Sex", and "Race". > > Is the following formula correct? > tapply(dat$WEIGHT, > by=list(dat$AGE,as.factor(dat$Group),as.factor(dat$EX),as.factor(dat$RACE)),cor) > > > Thanks, > Santosh > > > On Tue, Jul 14, 2009 at 7:34 PM, Santosh <santosh2...@gmail.com> wrote: > >> Hi R-users, >> >> Was wondering if there is a way to quickly compute correlations between >> continuous variables grouped by some categorical variables? >> >> What function do I use? >> >> Thanks much in advance. >> >> Regards, >> Santosh >> > > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org 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.