Generate correlation matrix based on event counts
Examples
# Build the transition matrix
m <- matrix(c(
0, 0.5, 0.5,
0.5, 0, 0.5,
0.5, 0.5, 0
), nrow = 3, byrow = TRUE)
# initialize weights
w <- c(1 / 3, 1 / 3, 1 / 3)
# Input event count of intersection of paired hypotheses - Table 2
event <- tibble::tribble(
~H1, ~H2, ~Analysis, ~Event,
1, 1, 1, 155,
2, 2, 1, 160,
3, 3, 1, 165,
1, 2, 1, 85,
1, 3, 1, 85,
2, 3, 1, 85,
1, 1, 2, 305,
2, 2, 2, 320,
3, 3, 2, 335,
1, 2, 2, 170,
1, 3, 2, 170,
2, 3, 2, 170
)
# Generate correlation from events
gs_corr <- generate_corr(event)