Produce fitted model for group (treatment or control)
Source:R/fulldata_model.R, R/within_group_model.R
fit_SensIAT_within_group_model.RdProduces a fitted model that may be used to produce estimates of mean and variance for the given group.
Arguments
- data
the full data set.
- trt
an expression that determine what is treated as the treatment. Everything not treatment is considered control.
- ...
common arguments passed to
fit_SensIAT_within_group_model.- group.data
The data for the group that is being analyzed. Preferably passed in as a single
tibblethat internally is subsetted/filtered as needed.- outcome_modeler
function for fitting the outcome model. Called with a formula, data argument and
outcome.argslist.- id
The variable that identifies the patient.
- outcome
The variable that contains the outcome.
- time
The variable that contains the time.
- knots
knot locations for defining the spline basis.
- alpha
The sensitivity parameter.
- End
The end time for this data analysis, we need to set the default value as the max value of the time.
- intensity.args
A list of optional arguments for intensity model. See the Intensity Arguments section.
- outcome.args
parameters as needed passed into the
outcome_modeler. One special element may be'model.modifications'which, if present, should be a formula that will be used to modify the outcome model per, update.formula.- influence.args
A list of optional arguments used when computing the influence. See the Influence Arguments section.
- spline.degree
The degree of the spline basis.
- add.terminal.observations
Logical indicating whether to add terminal observations to the data. If TRUE, data may not contain any
NAs. if FALSE, data will be assumed to already include the terminal observations
Value
a list with class SensIAT-fulldata-fitted-model with two components,
control and treatment, each of which is an independently fitted
SensIAT-within-group-fitted-model fit with the fit_within_group_model
function.
Should return everything needed to define the fit of the model. This can then be used for producing the estimates of mean, variance, and in turn treatment effect. For the full data model a list with two models one each for the treatment and control groups.
Details
This function should be agnostic to whether it is being provided a treatment or control group.
Functions
fit_SensIAT_fulldata_model(): Fit the sensitivity analysis for both treatment and control groups.
Intensity Arguments
The intensity.args list may contain the following elements:
model.modificationsA formula that will be used to modify the intensity model from it's default, per update.formula.kernelThe kernel function for the intensity model. Default is the Epanechnikov kernel.bandwidthThe bandwidth for the intensity model kernel.
Influence Arguments
The influence.args list may contain the following elements:
methodThe method for integrating, adaptive or fixed quadrature. Default is'adaptive'.toleranceThe tolerance when using adaptive quadrature.deltaThe bin width for fixed quadrature.resolutionalternative todeltaby specifying the number of bins.fix_discontinuityWhether to account for the discontinuity in the influence at observation times.