omnibusTest: Omnibus test

View source: R/stats.R

omnibusTestR Documentation

Omnibus test

Description

OmnibusTest calculates overall p-value for linear combination of variables using likelihood ratio test.

Usage

omnibusTest(
  object,
  omnibus_groups,
  placeholder = "term",
  correction = "bonferroni",
  n_correction = NULL
)

Arguments

object

An existing fit from a model function such as lm, glm and many others.

omnibus_groups

List of character vectors giving sets of variables for which omnibus test should be applied.

placeholder

String specifying term in object's formula which should be substituted with variables during analysis.

correction

String specifying multiple testing correction method. See details for further information.

n_correction

Integer specifying number of comparisons to consider during multiple testing correction calculations. For Bonferroni correction it is possible to specify a number lower than the number of comparisons being made. This is useful in cases when knowledge about the biology or redundance of alleles reduces the need for correction. For other methods it must be at least equal to the number of comparisons being made; only set this (to non-default) when you know what you are doing!

Details

Likelihood ratio test is conducted by comparing a model given in an object with an extended model, that is created by including the effect of variables given in variables as their linear combination.

Value

Data frame with columns:

  • "group" Omnibus group name

  • "term" Elements of omnibus group added to base model

  • "df" Difference in degrees of freedom between base and extended model

  • "logLik" Difference in log likelihoods between base and extended model

  • "statistic" Chisq statistic

  • "p.value" P-value

  • "p.adjusted" Adjusted p-value

Examples

midas <- prepareMiDAS(hla_calls = MiDAS_tut_HLA,
                      colData = MiDAS_tut_pheno,
                      experiment = "hla_aa")

# define base model
object <- lm(disease ~ term, data = midas)
omnibusTest(object,
            omnibus_groups = list(
              A_29 = c("A_29_D", "A_29_A"),
              A_43 = c("A_43_Q", "A_43_R")
            ))


Genentech/midasHLA documentation built on Feb. 12, 2024, 9:38 a.m.