# Valid case: Matching category counts
resp_matrix <- matrix(c(1,1,2,2, 1,2,3,1), ncol = 2)
check.response(resp_matrix, poly.value = c(2, 3)) # Returns TRUE
# Invalid case: Mismatched category counts
check.response(resp_matrix, poly.value = c(2, 2)) # Returns FALSE
# Special case: Uniform category counts bypass poly.value check
uniform_resp <- matrix(rep(1:2, each = 4), ncol = 2)
check.response(uniform_resp, poly.value = c(2, 5)) # Returns TRUE (bypass behavior)
Run the code above in your browser using DataLab