set_outcomes: Set the outcomes of an aba model.

Description Usage Arguments Value Examples

View source: R/aba_utils.R

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

1

Arguments

object

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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')

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