Skip to contents

The aba control which determines how an aba summary will be calculated and printed to console.

Usage

aba_control(
  include_intercept = FALSE,
  include_covariates = TRUE,
  pval_digits = 4,
  aic_digits = 0,
  metric_digits = 2,
  coef_digits = 2
)

Arguments

include_intercept

boolean. Whether to include intercept in coefs

include_covariates

boolean. Whether to include covariates in coefs

pval_digits

integer. How many decimals of a pvalue to show

aic_digits

integer. How many decimals of AIC value to show

metric_digits

integer. Default value of how many decimals to show for model metrics (e.g., auc, adj.r.squared, etc)

coef_digits

integer. Default value of how many decimals to show for model coefficients

Value

a list with the control parameters specified

Examples


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

# standard example
model <- df %>% aba_model() %>%
  set_groups(everyone()) %>%
  set_outcomes(CSF_ABETA_STATUS_bl) %>%
  set_predictors(
    PLASMA_PTAU181_bl, PLASMA_NFL_bl,
    c(PLASMA_PTAU181_bl, PLASMA_NFL_bl)
  ) %>%
  set_covariates(AGE, GENDER, EDUCATION) %>%
  set_stats('glm') %>%
  aba_fit()
#> [1] "CSF_ABETA_STATUS_bl ~ AGE + GENDER + EDUCATION"
#> [1] "CSF_ABETA_STATUS_bl ~ AGE + GENDER + EDUCATION + PLASMA_PTAU181_bl"
#> [1] "CSF_ABETA_STATUS_bl ~ AGE + GENDER + EDUCATION + PLASMA_NFL_bl"
#> [1] "CSF_ABETA_STATUS_bl ~ AGE + GENDER + EDUCATION + PLASMA_PTAU181_bl + PLASMA_NFL_bl"

# no control -> default
model_summary <- model %>% aba_summary()
print(model_summary)
#> ---------------------------------------------------------
#> Group: Everyone | Outcome: CSF_ABETA_STATUS_bl | Stat: S1
#> ---------------------------------------------------------
#> Coefficients & Metrics:
#> # A tibble: 4 × 10
#>   predictor AGE     GENDER EDUCATION PLASMA_PTAU181_bl PLASMA_NFL_bl auc  
#>   <chr>     <chr>   <chr>  <chr>     <chr>             <chr>         <chr>
#> 1 Basic     1.03 [… 1.39 … 0.93 [0.… NA                NA            0.58…
#> 2 M1        1.01 [… 1.31 … 0.96 [0.… 3.89 [2.80, 5.52… NA            0.72…
#> 3 M2        1.00 [… 1.43 … 0.94 [0.… NA                2.27 [1.48, … 0.63…
#> 4 M3        1.00 [… 1.33 … 0.96 [0.… 3.67 [2.61, 5.29… 1.29 [0.81, … 0.72…
#> # ℹ 3 more variables: aic <chr>, pval <chr>, nobs <chr>
#> 

# add a control object - don't include covariate coefficients
my_control <- aba_control(include_covariates = FALSE)
model_summary2 <- model %>% aba_summary(control = my_control)
print(model_summary2)
#> ---------------------------------------------------------
#> Group: Everyone | Outcome: CSF_ABETA_STATUS_bl | Stat: S1
#> ---------------------------------------------------------
#> Coefficients & Metrics:
#> # A tibble: 3 × 7
#>   predictor PLASMA_PTAU181_bl        PLASMA_NFL_bl auc   aic   pval  nobs 
#>   <chr>     <chr>                    <chr>         <chr> <chr> <chr> <chr>
#> 1 M1        3.89 [2.80, 5.52] (P<0.… NA            0.72… 799   <0.0… 645  
#> 2 M2        NA                       2.27 [1.48, … 0.63… 862   0.00… 645  
#> 3 M3        3.67 [2.61, 5.29] (P<0.… 1.29 [0.81, … 0.72… 800   <0.0… 645  
#>