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 <santosh2005@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]]