contrib - descriptive - correlation coefficient



> Here are my questions:
> 
> Q1: what is the most simple method to transform the splitted data
>     X:[8.5,13.7,15,16,16.9,15.1,13.9,12]; 
>     Y:[5.2,8.3,9.4,9.5,9.6,9.4,8.8,7.3];
>     into the above data_matrix_ XY as input for cov()?
> 
> Q2: is there a 'corr.ceff?'-function already implemented I have overlooked?
>     What method is to be prefered in your opinion?

Easy:

(%i1) X:[8.5,13.7,15,16,16.9,15.1,13.9,12]$
(%i2) Y:[5.2,8.3,9.4,9.5,9.6,9.4,8.8,7.3]$
(%i3) XY: transpose(matrix(X,Y))$
(%i4) load(descriptive)$
(%i5) cor(XY);
                   [        1.0         .9792845293082844 ]
(%o5)              [                                      ]
                   [ .9792845293082842  .9999999999999999 ]
(%i6) %[1,2];
(%o6)                          .9792845293082844

Function cor admits a second optional parameter, type ? cor


-- 
Mario Rodriguez Riotorto
www.biomates.net