set_outcomes: Set the outcomes of an aba model.

View source: R/aba_utils.R

set_outcomesR Documentation

Set the outcomes of an aba model.

Description

Outcomes are the dependent variables of the statistical models. This function supports both string inputs and actual variables as found in tidy-selection. The inputs should be separated by a comma, where each input is a different outcome You can also specify .labels for each outcome.

Usage

set_outcomes(.model, ..., .labels = NULL)

Arguments

.model

An aba model. The model for which you want to set outcomes

...

strings or variables. Each comma-seperated value will be a new outcome. If you give variables, then the data of the aba model should already be set.

.labels

vector of strings. Optional .labels for printing & plotting.

Value

An aba model with outcomes set.

Examples

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

# set with variables
model <- aba_model() %>%
  set_data(data) %>%
  set_outcomes(CDRSB, ADAS13, MMSE)

# supply .labels
model <- aba_model() %>%
  set_data(data) %>%
  set_outcomes(CDRSB, ADAS13, MMSE, .labels = c('CDR-SB','ADAS-13','MMSE'))

# supply strings - data does not need to be set first here. But it will
# result in an error if these variables do not éxist in the eventual data.
model <- aba_model() %>%
  set_outcomes('CDRSB', 'ADAS13', 'MMSE')

ncullen93/abaR documentation built on Feb. 8, 2024, 12:01 p.m.