[R] pairwise scatterplot matrix

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Thu Aug 5 18:49:46 CEST 1999


Jorge Magalhaes <root at mail.telepac.pt> writes:

> It is possible with this command (> pairs(X))  to draw a figure which both indicates the values of correlation coefficients and give the linear regressions of variables? Like  this:
> 
> 
> 
> 	|    X1  |   C12  |   C13  |   C14   |
> 	|X2 vs X1|   X2   |   C23  |   C24   |
> 	|X3 vs X1|X3 vs X2|   X3   |   C34   |
> 	|X4 vs X1|X4 vs X2|X4 vs X3|   X4    |
> 
> Cij indicate the value of the correlation coefficient for the linear regression of the variable i  with the variable j. i=1...4, j=1...4
> Xi vs Xj indicate a plot(Xi,Xj).

Offhand, no. But it doesn't look excessively complicated to make a
customised version of pairs.default. Hint: there's an if (i == j) {}
construct in the middle of everything, now if you were to split the
else clause into i<j and i>j and do something with text(...) in the
former case (like it already happens for i==j).

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list