These functions define output tasks that include the selected variables in the output of the generated model.
tsk_output(filename = "sdtab", variables) tsk_output_xpose4()
filename | The filename for the output file |
---|---|
variables | The model variables that be included in the output |
A building block of type 'output_task'
Tasks are building blocks that allow to specify what a model should
“do”. Like other model building blocks, they can be combined using
the +
operator. However, they should not be added to a model but
rather provided via the tasks=
argument to the render function, e.g.,
render(m, tasks = tsk_estimation() + tsk_output_xpose4())
For NONMEM, an output task defines the $TABLE
records by specifying the filename=
as well as the variables=
to include.
The variables can be specified by providing a character vector of variable names (e.g., variables = c('cl','v')
) or by
using a set of variable selection helpers (e.g., variables = vars_prms()
). The latter is shorter if many variables are to
be selected and allows the specification of tasks independent from the model. The details of the variable selection language
can be found on the help pages for model-variable-selection.
The tsk_output_xpose4()
function includes $TABLE
records that follow the output conventions of the model diagnostic package xpose4.
It is a shortcut for the following two output tasks:
xpose4_output <- tsk_output("sdtab", variables = any_of(c("id","time")) | vars_nm_std()) + tsk_output("patab", variables = vars_prms() | vars_eta())
Other tasks:
tsk_estimation()
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 model parameters to file 'prms' render(m, tasks = tsk_output("prms", variables = vars_prms()))#> $PROBLEM #> $INPUT DOSE ID DV #> $DATA data.csv IGNORE=@ #> $PRED #> EMAX = THETA(1) * EXP(ETA(1)) #> ED50 = THETA(2) * EXP(ETA(2)) #> EFFECT = EMAX * DOSE/(ED50 + DOSE) #> Y = EFFECT + EFFECT * EPS(1) #> $TABLE EMAX ED50 FILE=prms NOAPPEND NOPRINT #> $THETA (0, 10, Inf) ; POP_EMAX #> $THETA (0, 50, Inf) ; POP_ED50 #> $OMEGA 0.09 ; IIV_EMAX #> $OMEGA 0.09 ; IIV_ED50 #> $SIGMA 1; RUV_PROP#> $PROBLEM #> $INPUT DOSE ID DV #> $DATA data.csv IGNORE=@ #> $PRED #> EMAX = THETA(1) * EXP(ETA(1)) #> ED50 = THETA(2) * EXP(ETA(2)) #> EFFECT = EMAX * DOSE/(ED50 + DOSE) #> Y = EFFECT + EFFECT * EPS(1) #> $TABLE DV PRED RES WRES IPREDI IWRESI CWRES FILE=sdtab NOAPPEND NOPRINT #> $TABLE EMAX ED50 ETA(1) ETA(2) FILE=patab NOAPPEND NOPRINT #> $THETA (0, 10, Inf) ; POP_EMAX #> $THETA (0, 50, Inf) ; POP_ED50 #> $OMEGA 0.09 ; IIV_EMAX #> $OMEGA 0.09 ; IIV_ED50 #> $SIGMA 1; RUV_PROP