analyzeAssociations | R Documentation |
analyzeAssociations
perform association analysis on a single variable
level using a statistical model of choice.
analyzeAssociations(
object,
variables,
placeholder = "term",
correction = "bonferroni",
n_correction = NULL,
exponentiate = FALSE
)
object |
An existing fit from a model function such as lm, glm and many others. |
variables |
Character vector specifying variables to use in association tests. |
placeholder |
String specifying term in |
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! |
exponentiate |
Logical flag indicating whether or not to exponentiate
the coefficient estimates. Internally this is passed to
|
correction
specifies p-value adjustment method to use, common choice
is Benjamini & Hochberg (1995) ("BH"
). Internally this is passed to
p.adjust.
Tibble containing combined results for all variables
. The
first column "term"
hold the names of variables
. Further
columns depends on the used model and are determined by associated
tidy
function. Generally they will include "estimate"
,
"std.error"
, "statistic"
, "p.value"
, "conf.low"
,
"conf.high"
, "p.adjusted"
.
midas <- prepareMiDAS(hla_calls = MiDAS_tut_HLA,
colData = MiDAS_tut_pheno,
experiment = "hla_alleles")
# analyzeAssociations expects model data to be a data.frame
midas_data <- as.data.frame(midas)
# define base model
object <- lm(disease ~ term, data = midas_data)
# test for alleles associations
analyzeAssociations(object = object,
variables = c("B*14:02", "DRB1*11:01"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.