get_sign_mod: Adjust choose_on_aic() output for multiple comparisons

View source: R/get_sign_mod.R

get_sign_modR Documentation

Adjust choose_on_aic() output for multiple comparisons

Description

get_sign_mod() adjusts the p value related to the F statistic of each "best model" provided by choose_on_aic().

The function first filters out every best model containing only the intercept (1) as independent variable (dependent variable ~ mean(dependent variable)).

Adjustment for multiple comparisons then relies either on false discovery rate (FDR) using the Benjamini-Hochberg procedure, or on one of the following adjustment methods: "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none".

Best models receive a label "best_is_sign" = TRUE if the p value related to their F statistic reaches statistical significance after adjustment (passed FDR correction, or adjusted value <= 0.05) AND the p value of the t statistic related to the independent variable of interest <= 0.05.

Usage

get_sign_mod(tibble, method, FDR = 0.2)

Arguments

tibble

a tibble produced by choose_on_aic().

method

a string indicating the adjustment method to be used. Must be one of "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", and "none".

FDR

a numeric indicating the q-value threshold to use for FDR.

Value

A tibble containing, for each combination of dependent variable, independent variable of interest and covariates, i) the corresponding best model, ii) its associated statistics (F p value, t p value) and iii) the label "best_is_sign" = TRUE/FALSE.

Combinations of dependent variable, independent variable of interest and covariates for which the best model contains only the intercept as independent variable are discarded, so the output may be shorter than the input tibble.


benvallin/banban documentation built on Sept. 29, 2023, 5:46 a.m.