set_stats: Set the stats of an aba model

Description Usage Arguments Details Value Examples

View source: R/aba_utils.R

Description

Stats are the objects which specify 1) how model formulas should be created from the model specification, and 2) how to actual fit statistical models. Stats also have their own parameters which you can specify to change how the stat is fit. Multiple stats can be specified for an aba model. The best way to see all the available stats is the type aba::stat_ in the console and look at the auto-completion.

Usage

1
set_stats(.model, ..., labels = NULL)

Arguments

.model

an aba model. The model on which to set stats.

...

strings or aba stat object. Each comma-separated value will be a different stat. If you specify a string, then the default stat params will be used. Some stats require that you actually call them (e.g. stat_lme) because they require other parameters like id and time variables.

labels

vector of strings. Labels for printing & plotting.

Details

There is a broad collection of stats implemented in aba which we plan to add to. Please feel free to request more. Also, there are certain extra parameters which are common to all stats. These include std.beta which determines whether to z-score all variables prior to model fitting, and complete.cases which determines whether to only use individuals with all available data within each group - outcome but across all predictor sets.

Value

An abaModel object with stats sets.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# create default stat object by specifying only a string
model <- aba_model() %>%
  set_stats('glm')

# pass an actual stat object. This is useful to specify extra params
# such as `std.beta` and `complete.cases` which is common to all stats.
model <- aba_model() %>%
  set_stats(
    stat_glm(std.beta = TRUE, complete.cases = FALSE)
  )

# some stats such as lme require parameters
# those variables are expected to exist in the eventual data
model <- aba_model() %>%
  set_stats(
    stat_lme(id = 'RID', time = 'YEARS_bl')
  )

# you can see these extra stat params when you print the model
print(model)

aba documentation built on Dec. 17, 2021, 1:06 a.m.