I've got 400 store departments and I'm running (Pearson) correlations between all the departments. How can I output the 'N' (number of cases) and the significance level (p value)?
I'm using the cor function. Here is my current code which works fine:
numprod <- ncol(data) - 2;
matrix <- as.matrix(data[ ,2:numprod]);
AllChannels <- cbind(matrix(nrow = numprod-1,"All channels"),cor(matrix, use="all.obs", method="pearson"));
In SPSS, when you run a correlation it outputs the correlation coefficient, N and significance. This is my desired result.
Thanks all!
Lucas