Skip to contents

Compute bootstrap covariance of estimates

Usage

calculate_covariance(
  data,
  ids_by_analysis = NULL,
  bootstrap_ids = NULL,
  bootstrap_results = NULL,
  estimation_function,
  estimation_arguments,
  rng_seed,
  control = monitored_analysis_control()
)

Arguments

data

A data.frame containing the data to be analyzed. A column named .id indicates which observations correspond to each individual.

ids_by_analysis

A list containing the IDs that were enrolled before each analysis occurred

bootstrap_ids

A list of IDs resampled at earlier analyses: this is NULL in the first analysis

bootstrap_results

A numeric matrix of estimates: the bootstrap estimates for each analysis is stored in the corresponding column.

estimation_function

A function whose arguments include a data.frame named data

estimation_arguments

A list of any additional arguments needed by estimation_function

rng_seed

A numeric scalar for seeding the L'Ecuyer pseudorandom number generator

control

A list of computing arguments. See monitored_analysis_control for details about the default computing arguments.

Value

A list containing the covariance matrix of estimates, a matrix of bootstrap estimates, and a list of the IDs of individuals in each bootstrap replicate at each analysis.

See also

calculate_covariance() for computing the covariance matrix of estimators across analyses, and monitored_analysis_control for details about the default computing arguments.

Examples

# To be added