Quantity Grid Specification
Grid-Functions.Rd
These functions are used to specify which subjects and timepoints should be generated
when calculating quantities via SurvivalQuantities
and LongitudinalQuantities
.
Usage
GridEven(subjects = NULL, length.out = 30)
GridEvent(subjects = NULL)
GridFixed(subjects = NULL, times = NULL)
GridGrouped(groups, times = NULL)
GridManual(spec)
GridObserved(subjects = NULL)
GridPopulation(times = NULL)
GridPrediction(times = NULL, newdata, params = list())
Arguments
- subjects
(
character
orNULL
)
vector of subjects to extract quantities for. IfNULL
will default to all subjects within the dataset.- length.out
(
numeric
)
number of evenly spaced timepoints to generate quantities at.- times
(
numeric
orNULL
)
vector of time points to extract quantities at. IfNULL
will default to 201 evenly spaced timepoints between 0 and either the max observation time (forLongitudinalQuantities
) or max event time (forSurvivalQuantities
).- groups
(
list
)
named list of subjects to extract quantities for. See Group Specification.- spec
(
list
)
named list of subjects to extract quantities for. The names of each element should be the required subjects with the element itself being a numeric vector of timepoints to generate the quantity at.- newdata
(
data.frame
)
new data to generate quantities for. Must contain the same columns and factor levels of the original data used in theDataSurvival
object.- params
(
list
)
named list of parameters to fix the longitudinal model parameters at when predicting survival quantities. SeegetPredictionNames()
for the required parameters.
Details
GridFixed()
is used to specify a fixed set of timepoints to generate quantities at for all the specified subjects.GridGrouped()
is similar toGridFixed()
but allows for groupwise averaging (see Group Specification).GridObserved()
generates quantities at the observed longitudinal timepoints for each subject.GridManual()
allows for individual timepoint specification for each subject.GridEven()
generates quantities for each subject at N evenly spaced timepoints between each subjects first and last longitudinal observations.GridEvent()
generates one quantity for each subject at their event/censor time as indicated by thetime
variable in the survival dataset.GridPopulation()
generates longitudinal model quantities based on the population parameters at the specified time points. Generates 1 set of quantities for each distinct combination ofarm
andstudy
within theDataSubject
object provided to theJointModel
.GridPrediction()
generates survival quantities based on any user-defined values at the specified time points. This is useful for generating quantities for a new dataset on specific longitudinal model parameters. SeegetPredictionNames()
to determine which longitudinal model parameters need to be defined for a given longitudinal model.
Group Specification
For GridGrouped()
, groups
must be a named list of character vectors. Each element of the list
must be a character vector of the subjects that will form the group where the element name
is the corresponding name of the group. For example if the goal was to create two groups
named Group-1
and Group-2
which are composed of the subjects sub-1
, sub-2
and
sub-3
, sub-4
respectively then this would be specified as: