How can I run the correl function on non-contiguous columns. Selecting data in contiguous columns works just fine. But when I select data in non contiguous columns, the correl function is greyed out. What to do?
“… But when I select data in non contiguous columns, the correl function is greyed out.”
Yes. The tool requires a contiguous range of 1D-arrays of data.
What to do?
Rearrange your sheet to make the columns (in your case - otherwise rows) adjacent, or find a place where you can pull second instances of the data to, forming a contiguos arrangement.
[Editing 2021-02-07 about 15:10 UTC]
The function mentioned under -4-
in my comment below can also be enhanced by user code to a function, say CORRELATIONMATRIX()
allowing to create correlation matrices for any collection of equally dimensioned data sequences without expecting them to be located in a specific way.
See attachment. It contains raw code for the purpose.
ask291730correlationMatrix.ods
OK, I regard that as a bug or a feature request. It really should be possible to give a non contiguous list of columns for a function like this.
-1- For bug reports (including feature requests) go to https://bugs.documentfoundation.org
-2a- My answer was about the routine I thought you had in mind: >Data>Statistics>Correlation...
-2b- This is what can return a correlation matrix for adjacent 1D-arrays of data.
-3- The function CORREL() takes two equally dimensioned arrays of data and returns their correlation.
-4- You can use the CORREL() function to create a correlation matrix or any arrangement of correlations of any set of equally dimensioned arrays of data, and get exactly what you want.