bh_adj | R Documentation |
This function takes a lm or glm model object and returns a tibble with the Benjamini-Hochberg adjustment for false discovery rate applied. New columns include p-value rank ('rank'), adjusted alpha ('adj_a'), adjusted p-values ('p_bh'), star indicators for significance level ('stars_bh'), and a logical indicator of significance with the Benjamini-Hochberg adjustment applied ('sig_bh').
bh_adj(x, fdr = 0.05, coef_vec = NULL, p_name = NULL)
x |
Model summary object. For example, summary(model). |
fdr |
False discovery rate. 0.05 by default. |
coef_vec |
Optional. A vector of coefficient names as strings. p-values associated with the coefficients in this vector will be included in the adjustment and all other coefficients will be excluded. |
p_name |
Optional. The name of the p-value column in the summary object that results from running summary(x), where x is your model. By default, the function will look for "Pr(>|t|)" and "Pr(>|z|)". If neither of these is found and the correct 'p_name' is not specified, an error will result. |
A tibble
m1 <- lm(mpg ~ cyl + hp + wt, data = mtcars)
bh_adj(m1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.