[R] decompose a correlation matrix

2004-09-23 Thread Mark Strivens
Thanks guys for the help, here's the final (grizzly?) solution: #generate a correlation matrix cm<-cor(someDataFrame, y = NULL ...) # get the list of labels (included in the dataframe) labels<-labels(cm)[[1]] # retrieve the uppper portion of the correlation matrix (as logical values) idx <- uppe

RE: [R] decompose a correlation matrix

2004-09-23 Thread Ted Harding
On 23-Sep-04 Mark Strivens wrote: > Is there a simple way to decompose the upper triangle > of a correlation matrix to a linear list; > > For example: > > X Y Z > X 1 2 3 > Y 2 1 4 > Z 3 4 1 > > so you get a list like: > > xy 2 > XZ 3 > YZ 4 > > I suspect you can do it with a matrix transfor

RE: [R] decompose a correlation matrix

2004-09-23 Thread Liaw, Andy
> From: Mark Strivens > > Thanks for the answers the appear to be just > right. > > i.e. > > corrmat[upper.tri(corrmat)] > > or > > x[col(x)>row(x)] > > The slight problem is I lose all the column & > row labels from the correlation matrix, so I > am not sure of the order of the values (i

RE: [R] decompose a correlation matrix

2004-09-23 Thread Liaw, Andy
> From: Duncan Murdoch > > On Thu, 23 Sep 2004 13:08:53 -0500, "Mark Strivens" > <[EMAIL PROTECTED]> wrote : > > >Is there a simple way to decompose the upper triangle > >of a correlation matrix to a linear list; > > > >For example: > > > > X Y Z > >X 1 2 3 > >Y 2 1 4 > >Z 3 4 1 > > > >so you ge

[R] decompose a correlation matrix

2004-09-23 Thread Mark Strivens
Thanks for the answers the appear to be just right. i.e. corrmat[upper.tri(corrmat)] or x[col(x)>row(x)] The slight problem is I lose all the column & row labels from the correlation matrix, so I am not sure of the order of the values (i.e. which combination of markers the value represent

RE: [R] decompose a correlation matrix

2004-09-23 Thread Baskin, Robert
] > y [1] 5 9 10 13 14 15 > bob -Original Message- From: Mark Strivens [mailto:[EMAIL PROTECTED] Sent: Thursday, September 23, 2004 2:09 PM To: [EMAIL PROTECTED] Subject: [R] decompose a correlation matrix Is there a simple way to decompose the upper triangle of a correlation

Re: [R] decompose a correlation matrix

2004-09-23 Thread Duncan Murdoch
On Thu, 23 Sep 2004 13:08:53 -0500, "Mark Strivens" <[EMAIL PROTECTED]> wrote : >Is there a simple way to decompose the upper triangle >of a correlation matrix to a linear list; > >For example: > > X Y Z >X 1 2 3 >Y 2 1 4 >Z 3 4 1 > >so you get a list like: > >xy 2 >XZ 3 >YZ 4 > >I suspect you ca

[R] decompose a correlation matrix

2004-09-23 Thread Mark Strivens
Is there a simple way to decompose the upper triangle of a correlation matrix to a linear list; For example: X Y Z X 1 2 3 Y 2 1 4 Z 3 4 1 so you get a list like: xy 2 XZ 3 YZ 4 I suspect you can do it with a matrix transformation, but that beyond me at present. Many thanks Mark __