Skip to contents

Adjust the p-values (model and/or coefficients) of an abaSummary object.

Usage

aba_adjust(
  method = c("none", "bonferroni", "fdr", "hochberg", "holm", "hommel", "BH", "BY"),
  family = c("group", "outcome", "stat"),
  target = c("metric", "coef")
)

Arguments

method

string. The method to adjust with. See p.adjust.

family

vector. Which factors to consider a family together Possible choices: group, outcome, stat, predictor

target

vector. Whether to adjust both metrics and coefs, or just one.

Value

an abaSummary object. The abaSummary passed to aba_adjust but with p-values changed according to how the user specified.

Examples


df <- adnimerge %>% dplyr::filter(VISCODE == 'bl')

model <- df %>% aba_model() %>%
  set_groups(everyone()) %>%
  set_outcomes(ConvertedToAlzheimers, CSF_ABETA_STATUS_bl) %>%
  set_predictors(
    PLASMA_ABETA_bl, PLASMA_PTAU181_bl, PLASMA_NFL_bl,
    c(PLASMA_ABETA_bl, PLASMA_PTAU181_bl, PLASMA_NFL_bl)
  ) %>%
  set_stats('glm') %>%
  fit()
#> [1] "ConvertedToAlzheimers ~ PLASMA_ABETA_bl"
#> [1] "ConvertedToAlzheimers ~ PLASMA_PTAU181_bl"
#> [1] "ConvertedToAlzheimers ~ PLASMA_NFL_bl"
#> [1] "ConvertedToAlzheimers ~ PLASMA_ABETA_bl + PLASMA_PTAU181_bl + PLASMA_NFL_bl"
#> [1] "CSF_ABETA_STATUS_bl ~ PLASMA_ABETA_bl"
#> [1] "CSF_ABETA_STATUS_bl ~ PLASMA_PTAU181_bl"
#> [1] "CSF_ABETA_STATUS_bl ~ PLASMA_NFL_bl"
#> [1] "CSF_ABETA_STATUS_bl ~ PLASMA_ABETA_bl + PLASMA_PTAU181_bl + PLASMA_NFL_bl"

# no adjustment
model_summary <- model %>% aba_summary()

# default - correct within group, outcome, and stat (x4 comparisons)
model_summary_adj <- model %>%
  aba_summary(adjust = aba_adjust(method='bonferroni'))

# correct within group but across outcomes (x8 comparisons)
model_summary_adj2 <- model %>%
  aba_summary(adjust=aba_adjust(method='bonferroni', family = c('group')))

# correct only model P-values, not coefficient P-values
model_summary_adj3 <- model %>%
  aba_summary(adjust=aba_adjust(target = c('metric')))