obs.boot.var: Calculate bootstrapped variance estimates in an observational...

View source: R/obs.boot.var.R

obs.boot.varR Documentation

Calculate bootstrapped variance estimates in an observational setting.

Description

Calculates bootstrapped variance estimates of delta, delta.s, and R.s, and optionally calculates p-values for identifying individuals for whom the surrogate is strong.

Usage

obs.boot.var(df.train, df.test, type, numeric_predictors, categorical_predictors, 
  threshold, use.actual.control.S, gam.smoothers, tree.tuners)

Arguments

df.train

A dataframe containing training data.

df.test

A dataframe containing testing data.

type

Options are "linear", "gam", "trees", or "all"; type of base learners to use.

numeric_predictors

The column names in the dataframes that represent numeric baseline covariates.

categorical_predictors

The column names in the dataframes that represent categorical baseline covariates.

threshold

An optional threshold to test individuals for the null hypothesis that PTE is greater than the threshold.

use.actual.control.S

TRUE or FALSE, if user prefers to use the actual observed values for the surrogate in the control group instead of predicting values from the base learners.

gam.smoothers

A list of smoothing parameters to use for GAM base learners, so they are not retuned with bootstrapping iterations ("m1sp", "m0sp", "m1ssp", "m0ssp", "s0")

tree.tuners

A list of tuning parameters to use for tree base learners, so they are not retuned with bootstrapping iterations ("m1sp", "m0sp", "m1ssp", "m0ssp", "s0")

Value

A dataframe is returned, which is the df.test argument with new columns appended for the estimated variances of delta, delta.s, and R.s, as well as p-values if a threshold is provided.


cohetsurr documentation built on April 11, 2025, 6:10 p.m.