View source: R/value_milestone.R
| value_milestone | R Documentation |
Scan the visits in chronological order to detect the first outcome value reaching or exceeding a specified disability milestone (e.g., EDSS>=6), with confirmation.
value_milestone(
data,
milestone,
subj_col,
value_col,
date_col,
outcome,
worsening = NULL,
relapse = NULL,
rsubj_col = NULL,
rdate_col = NULL,
validconf_col = NULL,
conf_days = 12 * 7,
conf_tol_days = c(7, 2 * 365.25),
require_sust_days = 0,
relapse_to_event = 0,
relapse_to_conf = 30,
impute_last_visit = 0,
date_format = NULL,
verbose = 0
)
data |
Data frame containing longitudinal data, including: subject IDs, outcome values, visit dates. |
milestone |
Disability milestone (outcome value to check data against). |
subj_col |
Name of data column with subject IDs. |
value_col |
Name of data column with outcome values. |
date_col |
Name of data column with visit dates. |
outcome |
Specifies the outcome type. Must be one of the following:
When it's not set to |
worsening |
The direction of worsening ( |
relapse |
Optional data frame containing longitudinal data, including subject IDs and relapse onset dates. |
rsubj_col |
Name of subject ID column in the |
rdate_col |
Name of date column in the |
validconf_col |
Name of data column, if any, specifying which visits can
( |
conf_days |
Period before confirmation (days). Can be a single value, or
vector of any length if considering multiple windows.
If |
conf_tol_days |
Tolerance window for confirmation visit (days); can be
an integer (equal lower and upper tolerance)
or vector of length 2 (different lower and upper tolerance).
The right end of the interval can be set to |
require_sust_days |
Minimum number of days over which the milestone must be sustained
(i.e., confirmed at all visits occurring in the specified period).
If the milestone is sustained for the remainder of the follow-up period, it is considered reached regardless of follow-up duration.
If |
relapse_to_event |
Minimum distance (days) from the onset of a relapse for the milestone to be considered reached. Can be an integer (minimum distance from last relapse onset) or vector of length 2 (minimum distance from last relapse onset, minimum distance from next relapse onset). Note that setting the distance to zero means retaining the event regardless of surrounding relapses. |
relapse_to_conf |
Minimum distance (days) from the onset of a relapse for a visit to be a valid confirmation visit. Can be an integer (minimum distance from last relapse onset) or vector of length 2 (minimum distance from last relapse onset, minimum distance from next relapse onset). Note that setting the distance to zero means using any visit for confirmation regardless of surrounding relapses. |
impute_last_visit |
Imputation probability when the milestone is reached
at the last available visit (i.e., with no confirmation).
Unconfirmed values exceeding the milestone at the last visit are never imputed
if |
date_format |
Format of dates in the
If not specified, function |
verbose |
One of:
|
"Reaching or exceeding" means either value>=milestone or value<=milestone, depending on the
direction of worsening (see arguments outcome and worsening).
An event is only considered "observed" if confirmed, i.e., if all values up to the confirmation visit reach or exceed the milestone.
A data frame containing the following columns:
<date_col>: the date of first reaching or exceeding the milestone with confirmation
(or last date of follow-up if milestone is not reached or not confirmed).
<value_col: the first value reaching or exceeding the milestone with confirmation,
if present, otherwise no value.
"time2event": the time taken to reach or exceed the milestone (or total
follow-up length if milestone is not reached or not confirmed).
"observed": whether the milestone was reached with confirmation (1) or not (0).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.