validate_contingency_table: Check if contingency table parameters are sufficient and...

View source: R/validate_contingency_table.R

validate_contingency_tableR Documentation

Check if contingency table parameters are sufficient and valid to calculate an odds ratio

Description

The validate_contingency_table() function determines if the set of provided parameters match a set of parameters (a 'grain') that is sufficient to calculate an odds ratio and its confidence intervals. Additionally, it checks if those parameters are valid.

Usage

validate_contingency_table(
  .A = NA,
  .B = NA,
  .C = NA,
  .D = NA,
  .nexp = NA,
  .nref = NA
)

Arguments

.A, .B, .C, .D

Integer: counts of outcomes.

.nexp

Integer: the total number exposed to the factor.

.nref

Integer: the total number not exposed to the factor (referent).

Details

A contingency table is shown here.

Outcome+ Outcome- Total
Exposed A B nexp
Referent C D nref

See check_grain for more details.

Value

A list of three values: is_valid (logical), status (string), and table_type (string).


iAM-AMR/sawmill documentation built on June 30, 2024, 2:25 a.m.