gestboot {gesttools}R Documentation

Percentile Based Bootstrap Confidence Intervals

Description

Generates percentile based confidence intervals for the causal parameters of a fitted SNMM. Bonferroni corrected confidence intervals are also reported for multiple comparisons.

Usage

gestboot(
  gestfunc,
  data,
  idvar,
  timevar,
  Yn,
  An,
  Cn,
  outcomemodels,
  propensitymodel,
  censoringmodel = NULL,
  type,
  EfmVar = NA,
  cutoff,
  bn,
  alpha = 0.05,
  onesided = "twosided",
  seed = NULL,
  ...
)

Arguments

gestfunc

Name (without quotations) of the g-estimation function to run. One of gestSingle or gestMultiple.

data, idvar, timevar, Yn, An, Cn, outcomemodels, propensitymodel, censoringmodel, type, EfmVar, cutoff

Same arguments as in gest functions, to be input into gestfunc.

bn

Number of bootstrapped datasets.

alpha

Confidence level of confidence intervals.

onesided

Controls the type of confidence interval generated. Takes one of three inputs, "upper" for upper one-sided confidence intervals, "lower" for lower one-sided confidence intervals, and "twosided" for two-sided confidence intervals. Defaults to "twosided".

seed

Integer specifying the random seed for generation of bootstrap samples.

...

additional arguments.

Value

Returns a list of the following four elements.

original

The value of the causal parameters estimated on the original data data.

mean.boot

The average values of the causal parameters estimated on the bootstrapped datasets.

conf

The upper and/or lower bounds of 1-\alpha confidence intervals for each element of \psi. For example, if type=2, and \psi=(\psi_0,\psi_1), a separate confidence interval is fitted for \psi_0 and \psi_1.

conf.Bonferroni

The upper and/or lower bounds of Bonferroni corrected confidence intervals for \psi, used for multiple comparisons.

boot.results

A tibble containing the result for each bootstrapped dataset

Examples

datas <- dataexamples(n = 1000, seed = 123, Censoring = FALSE)
data <- datas$datagest
data <- FormatData(
  data = data, idvar = "id", timevar = "time", An = "A",
  varying = c("A", "L"), GenerateHistory = TRUE, GenerateHistoryMax = 1
)
idvar <- "id"
timevar <- "time"
Yn <- "Y"
An <- "A"
Cn <- NA
outcomemodels <- list("Y~A+L+U+Lag1A", "Y~A+L+U+Lag1A", "Y~A+L+U+Lag1A")
propensitymodel <- c("A~L+U+as.factor(time)+Lag1A")
censoringmodel <- NULL
type <- 1
EfmVar <- NA
bn <- 5
alpha <- 0.05
gestfunc <- gestSingle
gestboot(gestfunc, data, idvar, timevar, Yn, An, Cn, outcomemodels, propensitymodel,
  censoringmodel = NULL, type = 1, EfmVar,
  bn = bn, alpha = alpha, onesided = "twosided", seed = 123
)

[Package gesttools version 1.3.0 Index]