[R] canonical correlation

John Fox jfox at mcmaster.ca
Sun Jul 13 16:45:45 CEST 2014


Dear Monaly,

What you described in simply the multiple LS regression of Y on the Xs, which finds the linear combination of the Xs most correlated with Y. Canonical correlation and regression are appropriate when there is more than one Y.

Best,
 John

On Sun, 13 Jul 2014 15:39:15 +0100
 Monaly Mistry <monaly.mistry at gmail.com> wrote:
> Dear John,
> 
> In my final model I have 10 independent variables that account for the
> variation in my dependent variable, and I needed to visually demonstrate
> this relationship.  So I did a canonical correlation to get a linear
> combination of independent variables that that predicts the variation in my
> dependent variable to plot the relationship. Although I ended up using 2
> dependent variables in the canonical correlation analysis.
> 
> Best,
> 
> Monaly.
> 
> 
> On Sun, Jul 13, 2014 at 3:16 PM, John Fox <jfox at mcmaster.ca> wrote:
> 
> > A small correction: I should have said "R", not "R^2".
> >
> > John
> >
> > On Sun, 13 Jul 2014 10:14:23 -0400
> >  "John Fox" <jfox at mcmaster.ca> wrote:
> > > Dear Raghuraman and Monaly,
> > >
> > > Why would one want to do canonical correlation with a single Y variable?
> > The canonical correlation is just the R^2 from the LS regression of Y on
> > the Xs.
> > >
> > > Best,
> > >  John
> > >
> > > ------------------------------------------------
> > > John Fox, Professor
> > > McMaster University
> > > Hamilton, Ontario, Canada
> > > http://socserv.mcmaster.ca/jfox/
> > >
> > >
> > > On Sun, 13 Jul 2014 09:00:52 +0100
> > >  Raghuraman Ramachandran <optionsraghu at gmail.com> wrote:
> > > > Try package CCA.
> > > >
> > > >
> > > > On Sat, Jul 12, 2014 at 11:13 PM, Monaly Mistry <
> > monaly.mistry at gmail.com>
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I was wondering if it's possible in R to do a canonical correlation
> > with
> > > > > only one dependent variable and several independent variables.
> > > > >
> > > > > I've tried using cc(X,Y) but I got an error message. In this case I
> > had 1
> > > > > dependent variable and 10 independent variables.
> > > > >
> > > > > Error in cor(X, use = "pairwise") :
> > > > >   supply both 'x' and 'y' or a matrix-like 'x'
> > > > >
> > > > > When I use two dependent variables I don't get the error message.
> > > > >
> > > > > Best,
> > > > >
> > > > > Monaly.
> > > > >
> > > > >         [[alternative HTML version deleted]]
> > > > >
> > > > > ______________________________________________
> > > > > R-help at 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.
> > > > >
> > > >
> > > >     [[alternative HTML version deleted]]
> > > >
> > > > ______________________________________________
> > > > R-help at 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.
> > >
> > > ______________________________________________
> > > R-help at 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.
> >
> > ------------------------------------------------
> > John Fox, Professor
> > McMaster University
> > Hamilton, Ontario, Canada
> > http://socserv.mcmaster.ca/jfox/
> >
> >
> >
> >
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list