View source: R/DPComb_Functions.R
| test_case_control_fisher | R Documentation |
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.
test_case_control_fisher(
Data,
response,
covariates,
method = "fisher_mean",
alternative = "two.sided"
)
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 |
alternative |
A character string indicating the tail for Fisher's exact test. One of "two.sided" (default), "greater", or "less", consistent with the |
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.
A list with the following elements:
The testing statistic combining statistical significance from Fisher's exact tests.
The testing p-value for the combination test.
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.