[R] How to measure correlations in terms of distance and draw them on a 2-dimmentional plot?

William Revelle lists at revelle.net
Thu Aug 19 02:08:49 CEST 2010


Weijian,
  Look at multidimensional scaling functions such as cmdscale or 
isoMDS (in MASS) or factor analysis (e.g., factanal in core R or  fa 
in the psych package) or item cluster analysis (ICLUST, also in 
psych).

What you will need to think about is how many dimensions best 
represent the 10 variables.  .One will just put them on a line, 2 
might or might not work depending upon your data, 3 ...

In terms of a distance matrix, in order to use an mds function, first 
you will need  to convert correlations to distances  try distance = 
sqrt (2 *(1-r)).,

Bill

At 2:47 PM -0700 8/18/10, weijian21cn wrote:
>Probably I put it too complicated.
>
>I just try to draw 10 points on a plot. Each point stand for one variable.
>If two variables are highly correlated, the corresponding dots are to be
>drawn closer. Say, variable X1, X2, X3, are highly correlated among them, so
>they will be clustered; variables X4, X5, X6 are not much correlated with
>X1,X2, X3, so X4-X5 are drawn far away from X1-X3.
>
>In addition, if corr(X1, X2) > corr(X2,X3), the plot can show distance(X1,
>X2) < distance(X2, x3).
>
>Do you know if R has such a package? Or I may use some plot function from
>cluster analysis?
>
>Thank you!
>
>Weijian
>--
>View this message in context: 
>http://r.789695.n4.nabble.com/How-to-measure-correlations-in-terms-of-distance-and-draw-them-on-a-2-dimmentional-plot-tp2330413p2330442.html
>Sent from the R help mailing list archive at Nabble.com.
>
>______________________________________________
>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