defineEndpoint
[Simulx] Define endpoint element
Define or edit an endpoint. Endpoints summarize the outcome values over all individuals, for each simulation group and each replicate. Endpoints are defined as in Simulx GUI.
Usage
defineEndpoint(name, element)
Arguments
- name
(character) (required) Endpoint name.
- element
(list) (required) List with the endpoint settings:
outcome
(character or list) (required) - Outcome on which the endpoint is based on. If one outcome, use a string containing its name. Use list to combine outcomes with:names
(vector of character) - Vector of outcome namesgroupName
(character) - Name you want to give to the outcome combinationoperator
(character) - Way in which output should be combined. One of "and"/"or" (in case of boolean outcomes) or "min"/"max" (in other cases)
metric
(character) (optional) - Calculation method for the endpoint. One of "arithmeticMean" (default), "geometricMean" or "median" if value-based outcome. In case of event-based outcomes, "kaplanMeier" (median survival) will be used and in case of boolean outcomes, "percentTrue" will be used by default.groupComparison
(optional) (list) - Group comparison settings. List of:type
(character) (optional) - one of "directComparison", "statisticalTest" (default).h1
(list) (optional) - a list containing hypothesis information:operator
(character) - one of "!=" (default), ">" or "<",threshold
(double) - a real number indicating the threshold for difference/oddsRatio (0 by default)pvalue
(double) - a real number indicating the p-value (iftype
is "statisticalTest", 0.05 by default)
Details
To compute the defined endpoints, use runEndpoints and get the results with
.getEndpointsResults
To specify if endpoints should be compared across simulation groups, use setGroupComparisonSettings
. If group comparison is relevant, the way the comparison will be done for each endpoint (eg if statistical test and which p-value) should be defined in the endpoint element.
See also
Examples
# Endpoint with group comparison
initializeLixoftConnectors("simulx")
project_name <- file.path(getDemoPath(), "6.outcome_endpoints", "6.1.outcome_endpoints", "OutcomeEndpoint_PKPD_changeFromBaseline.smlx")
loadProject(project_name)
defineEndpoint(name = "comparison", element = list(outcome = "changeFromBaseline", metric = "geometricMean", groupComparison = list(type = "statisticalTest", operator = "!=", threshold = "0", pvalue = 0.05)))
# Combine multiple outcomes
initializeLixoftConnectors("simulx")
project_name <- file.path(getDemoPath(), "6.outcome_endpoints", "6.1.outcome_endpoints", "OutcomeEndpoint_PDTTE_survival_NADIR_timeToNADIR.smlx")
loadProject(project_name)
defineEndpoint(name = "combined_endpoint", element = list(outcome = list(names = c("Survival", "TimeToNADIR_AsEvent"), groupName = "combined", operator = "min")))