fit_SensIAT_fulldata_model {SensIAT}R Documentation

Produce fitted model for group (treatment or control)

Description

Produces a fitted model that may be used to produce estimates of mean and variance for the given group.

Usage

fit_SensIAT_fulldata_model(data, trt, ...)

fit_SensIAT_within_group_model(
  group.data,
  outcome_modeler,
  knots,
  id.var,
  outcome.var,
  time.var,
  alpha = 0,
  intensity.covariates = ~.,
  outcome.covariates = ~. - 1,
  End = max({
     {
         time.var
     }
 }, na.rm = TRUE) + 1,
  integration.tolerance = .Machine$double.eps^(1/3),
  intensity.bandwidth = NULL,
  ...,
  influence.args = list()
)

Arguments

data

the full data set.

trt

an expression that determine what is treated as the treatment. Everything not treatment is considered control.

...

add parameters as needed or use this to pass forward into the outcome_modeler.

group.data

The data for the group that is being analyzed. Preferably passed in as a single tibble that internally is subsetted/filtered as needed.

outcome_modeler

A separate function that may be swapped out to switch between negative-binomial, single index model, or another we will dream up in the future.

knots

knot locations for defining the spline basis.

id.var

The variable that identifies the patient.

outcome.var

The variable that contains the outcome.

time.var

The variable that contains the time.

alpha

The sensitivity parameter.

intensity.covariates

A formula representing modifications to the intensity model.

outcome.covariates

A formula representing modifications to the outcome model. The default removes the intercept term.

End

The end time for this data analysis, we need to set the default value as the max value of the time

integration.tolerance

The tolerance for the integration.

intensity.bandwidth

The bandwidth for the intensity model kernel.

influence.args

A list of additional arguments to pass to the influence function.

Details

This function should be agnostic to whether it is being provided a treatment or control group.

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.

Functions

Examples


model <-
    fit_SensIAT_within_group_model(
        group.data = SensIAT_example_data,
        outcome_modeler = SensIAT_sim_outcome_modeler,
        alpha = c(-0.6, -0.3, 0, 0.3, 0.6),
        id.var = Subject_ID,
        outcome.var = Outcome,
        time.var = Time,
        End = 830,
        knots = c(60,60,60,60,260,460,460,460,460),
    )


[Package SensIAT version 0.1.0 Index]