xicor | R Documentation |
This function calculates Chatterjee's rank correlation coefficient, which measures the association between two variables. It is particularly useful for identifying monotonic relationships between variables, even if they are not linear.
xicor(x, y, ties = FALSE)
x |
A numeric vector representing the independent variable. |
y |
A numeric vector representing the dependent variable. |
ties |
A logical value indicating whether to handle ties in the data. Default is FALSE. If If |
Unlike Pearson's correlation (which measures linear relationships), Chatterjee's coefficient can handle non-linear monotonic relationships. It is robust to outliers and can handle tied ranks, making it versatile for datasets with ordinal data or tied ranks. This makes it a valuable alternative to Spearman's and Kendall's correlations, especially when the data may not meet the assumptions required by these methods.
By default, ties = FALSE
is set to prioritize computational efficiency, as
handling ties requires additional processing. In cases where ties are present
or likely (such as when working with ordinal or categorical data), it is
recommended to set ties = TRUE
.
A numeric value representing Chatterjee's rank correlation coefficient.
xicor(x = pq_data$Collaboration_hours, y = pq_data$Internal_network_size, ties = TRUE)
xicor(x = pq_data$Collaboration_hours, y = pq_data$Internal_network_size, ties = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.