Computes correlations between test statistics using the mathematically correct formulation that ensures positive definiteness and proper asymptotic properties.
Value
If return_matrix=TRUE, returns a symmetric correlation matrix. If return_matrix=FALSE, returns a data frame with columns H1, H2, Analysis1, Analysis2, Correlation.
Examples
library(tibble)
# Sample event data
event_data <- tribble(
~H1, ~H2, ~Analysis, ~Event,
1, 1, 1, 80,
2, 2, 1, 100,
1, 2, 1, 60,
1, 1, 2, 120,
2, 2, 2, 150,
1, 2, 2, 80
)
# Get correlation matrix
corr_matrix <- compute_correlations(event_data)
# Get detailed data frame
corr_df <- compute_correlations(event_data, return_matrix = FALSE)
