test_case_control_fisher: Combine Fisher's Exact Tests in Case-Control Analysis

View source: R/DPComb_Functions.R

test_case_control_fisherR Documentation

Combine Fisher's Exact Tests in Case-Control Analysis

Description

This function performs a combination test on case-control data with binary covariates by first obtaining p-values from Fisher's exact test for each covariate and then combining them using the DPComb_tests function.

Usage

test_case_control_fisher(
  Data,
  response,
  covariates,
  method = "fisher_mean",
  alternative = "two.sided"
)

Arguments

Data

A dataframe containing case-control data. It must include a column with 1 for cases and 0 for controls, and one or more columns representing binary covariates (with values 1 or 0).

response

A character string specifying the name of the response variable indicating cases and controls.

covariates

A vector of character strings specifying the names of the covariate columns to analyze.

method

A character string specifying the combination method to be used. Default is "fisher_mean". Supported methods include "fisher_mean", "fisher_median", "pearson", "george", "stouffer", and "edgington".

alternative

A character string indicating the tail for Fisher's exact test. One of "two.sided" (default), "greater", or "less", consistent with the fisher.test function.

Details

For each covariate, Fisher's exact test is performed to compute a p-value, based on the hypergeometric distribution under the null hypothesis. The parameters are derived from the total number of cases, controls, and the total count of 1's in each covariate. The DPComb_tests function is then applied to compute the test statistic and associated p-value for the combination of Fisher's exact tests.

Value

A list with the following elements:

Sn

The testing statistic combining statistical significance from Fisher's exact tests.

pval

The testing p-value for the combination test.

Examples

  # Load case-control data from DPComb
  data(case_control, package = "DPComb")
  covariates <- c("marker1", "marker2", "marker3", "marker4", "marker5")
  test_case_control_fisher(Data = case_control, response = "disease_status", 
                           covariates = covariates, 
                           method = "fisher_mean", alternative = "two.sided")

DPComb documentation built on Aug. 22, 2026, 5:08 p.m.