[Simulx] Define outcome element
Define or edit an outcome. Outcomes represent a post-processing of the simulation outputs done for each individual. Outcomes are defined as in Simulx GUI. Outcomes can only be defined by the user (no outcome is imported), and they are saved with the Simulx project if calling saveProject. Contrary to the GUI, defining an outcome with the connectors does not automatically generate an endpoint. To compute the defined outcomes, use them in endpoints with defineEndpoint, run runEndpoints and get the results with getEndpointsResults.
Usage
defineOutcome(name, element)
Arguments
name
(character) Outcome name.
element
(list) List with the outcome settings:
|
|
(character) |
Name of the output element on which the outcome is based. |
|
|
(logical) |
(optional) If occasions are present in the simulation, it indicates if the outcome is calculated for each id or each occasion of each id. TRUE by default. |
Then, if the outcome is based on a continuous or categorical output:
|
|
(list) |
(optional) List of elements that define reference settings:
|
|
|
(list) |
(required) List of elements that define how the output will be processed:
|
|
|
(list) |
(optional) List of elements:
|
Or if the outcome is based on a TTE output:
|
|
(list) |
(required) List of arguments that define event settings:
|
See also
Examples
# Define an outcome to calculate Cmax
initializeLixoftConnectors("simulx")
project_name <- file.path(getDemoPath(), "6.outcome_endpoints", "6.1.outcome_endpoints", "OutcomeEndpoint_PKPD_Cmax_targetInhibition.smlx")
loadProject(project_name)
defineOutcome(name = "Cmax_outcome", element = list(output = "Plasma_concentration", processing = list(operator = "max", type = "value")))
# Define time above MIC as percentage
initializeLixoftConnectors("simulx")
project_name <- file.path(getDemoPath(), "6.outcome_endpoints", "6.1.outcome_endpoints", "OutcomesEndpoints_antibiotics_TaboveMIC.smlx")
loadProject(project_name)
defineOutcome(name = "TimeAboveMIC", element = list(output = "mlx_Cc", processing = list(operator = "durationAbove", type = "percentTime", value = 0.5)))
# Relative outcome with threshold per individual and occasion
initializeLixoftConnectors("simulx")
project_name <- file.path(getDemoPath(), "6.outcome_endpoints", "6.1.outcome_endpoints", "OutcomeEndpoint_PKPD_LastPerOccasion.smlx")
loadProject(project_name)
defineOutcome(name = "custom_outcome", element = list(output = "prediction_Cc_per_id", perOccasion = TRUE, relativeTo = list(reference = "customValue", type = "difference", "value" = 2), processing = list(operator = "avg"), applyThreshold = list(operator = "<=", threshold = 2)))
# Event based outcome
initializeLixoftConnectors("simulx")
project_name <- file.path(getDemoPath(), "6.outcome_endpoints", "6.1.outcome_endpoints", "OutcomeEndpoint_PDTTE_survival_NADIR_timeToNADIR.smlx")
loadProject(project_name)
defineOutcome(name = "survival_outcome", element = list(output = "Death", event = list(type = "timeOfEvents")))