Learn R Programming

MDDC (version 1.1.0)

check_and_fix_contin_table: Verifying and correcting the input \(I\) by \(J\) contingency table

Description

Verify and correct the input \(I\) by \(J\) contingency table to ensure it is properly formatted as a data matrix with row (adverse event) and column (drug) names.

Usage

check_and_fix_contin_table(contin_table)

Value

A data matrix of an \(I\) by \(J\) contingency table with row and column names.

Arguments

contin_table

A data matrix or a data frame of an \(I\) by \(J\) contingency table with or without prespecified row and column names.

Examples

Run this code
# Create a 6 by 4 data matrix
set.seed(42)
dat_mat <- matrix(rpois(6 * 4, 20), nrow = 6)
dat_mat

# Check the format of the data matrix and assign row and column names
contin_table <- check_and_fix_contin_table(dat_mat)
contin_table

Run the code above in your browser using DataLab