model-variable-selection: Selecting model variables

model-variable-selectionR Documentation

Selecting model variables

Description

The output task allows to select model variables using a concise mini language. You can select variables by name or using one of the helper functions described below.

Overview of selection features

The selection of variables builds on the tidyselect package which implements a powerful variable selection language (see tidyselect::language). The following features are most relevant for the selection of model variables:

  • | for selecting the union of several variables

  • c() for combining selections

  • ! for taking the complement of a set of variables

In addition, you can select variables using a combination of the following helper functions:

  • vars_prms() selects all model parameters

  • vars_data() selects all data defined variables

  • vars_eta() selects all eta variables

  • vars_nm_std() selects the standard NONMEM variables DV, PRED, RES, WRES, IPREDI, IWRESI

  • vars_starts_with() selects variables that start with a prefix

  • vars_matches() selects variables that match a regular expression

Usage

vars_prms(vars)

vars_data(vars)

vars_eta(vars)

vars_nm_std(vars)

vars_starts_with(match, vars)

vars_matches(match, vars)

Arguments

vars

A character vector of variable names (taken from the selection context)

match

A character vector to match against

Value

A selection context

Examples


m <- model() +
  input_variable("dose") +
  prm_log_normal("emax", median = 10, var_log = 0.09) +
  prm_log_normal("ed50", median = 50, var_log = 0.09) +
  algebraic(effect~emax*dose/(ed50 + dose)) +
  obs_proportional(~effect, var_prop = 1)

# output all model parameter and eta variables
render(m, tasks = tsk_output("prms", variables = vars_prms() | vars_eta()))

sebastianueckert/assemblerr documentation built on Sept. 30, 2022, 9:12 a.m.