Skip to main content
Skip table of contents

defineOutcome

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

R
defineOutcome(name, element)

Arguments

name

(character) Outcome name.

element

(list) List with the outcome settings:

output(character)Name of the output element on which the outcome is based.
perOccasion(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:

relativeTo(list)(optional) List of elements that define reference settings:
  • reference - one of "baseline", "min", "max", "minCurrentTime", "maxCurrentTime" or "customValue",

  • type - "ratio" or "difference",

  • value - if reference is "customValue".

processing(list)(required) List of elements that define how the output will be processed:
  • operator (required) - one of "avg", "min", "max", "first", "last", "durationBelow", "durationAbove", "durationBetween", "timePoint", or "none" (if the output has a single time point and does not require processing).

  • type (optional)

    • if operator is "min" or "max", one of "value" (default), "timeContinuous" or "timeEvent",

    • if operator is "durationBelow", "durationAbove" or "durationBetween", one of "cumulativeTime" (default), "percentTime", "nbObs", "firstOccurenceContinuous" or "firstOccurenceEvent",

  • value (optional) - vector of boundaries if operator is "durationBelow", "durationAbove" or "durationBetween", or time point if operator is "timePoint" (0 by default).

applyThreshold(list)(optional) List of elements:
  • operator - one of "==", "!=", ">=", ">", "<=" or "<",

  • value - a real number indicating the threshold value.

Or if the outcome is based on a TTE output:

event(list)(required) List of arguments that define event settings:
  • type (required) - one of "timeOfEvents" (in case of single and repeated TTE), "hasAnEvent", "hasNoEvent" (in case of single TTE) or "numberOf" (in case of repeated TTE),

  • rank (optional) - rank of the event of which time is the outcome (if type is "timeOfEvents" and repeated TTE).

See also

Examples

R
# 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")))

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.