corr | R Documentation |
Calculates the weighted correlation given a data set and a set of weights.
corr(d, w = rep(1, nrow(d))/nrow(d))
d |
A matrix with two columns corresponding to the two variables whose correlation we wish to calculate. |
w |
A vector of weights to be applied to each pair of observations. The default
is equal weights for each pair. Normalization takes place within the function
so |
This function finds the correlation coefficient in weighted form. This is often useful in bootstrap methods since it allows for numerical differentiation to get the empirical influence values. It is also necessary to have the statistic in this form to find ABC intervals.
The correlation coefficient between d[,1]
and d[,2]
.
cor
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.