# \donttest{
# Example with custom test statistic emphasizing corner cells
obs.table <- matrix(c(10, 5, 8, 12), ncol = 2, byrow = TRUE)
# Define test statistic: sum of diagonal elements
diag_stat <- function(tb) {
sum(diag(tb))
}
# Run sensitivity analysis
result <- sampling.general.sen.IxJ(
obs.table = obs.table,
gamma = 0.5,
delta = c(0, 1),
transform.fun = diag_stat,
mc.iteration = 5000,
verbose = TRUE
)
# Custom u-space example
custom_u <- matrix(c(0, 0,
5, 0,
0, 8,
5, 8), ncol = 2, byrow = TRUE)
result_custom <- sampling.general.sen.IxJ(
obs.table = obs.table,
gamma = 0.5,
delta = c(0, 1),
transform.fun = diag_stat,
u_space = custom_u
)
# }
Run the code above in your browser using DataLab