LocalControlNearestNeighborsConfidence: Provides a bootstrapped confidence interval estimate for...

Description Usage Arguments Examples

Description

Given a number of bootstrap iterations and the params used to call LocalControl with outcomeType = "default", this function calls LocalControl nBootstrap times. The 50% and 95% quantiles are drawn from the distribution of results to produce the LTD confidence intervals.

Usage

1
2
3
4
5
LocalControlNearestNeighborsConfidence(data, nBootstrap, randSeed,
  treatmentColName, treatmentCode = "", outcomeColName, clusterVars,
  labelColName = "", numThreads = 1, radiusLevels = numeric(),
  radStepType = "exp", radDecayRate = 0.8, radMinFract = 0.01,
  normalize = TRUE, verbose = FALSE)

Arguments

data

DataFrame containing all variables which will be used for the analysis.

nBootstrap

The number of times to resample and run LocalControl for the confidence intervals.

randSeed

The seed used to set random number generator state prior to resampling. No default value, provide one for reproducible results.

treatmentColName

A string containing the name of a column in data. The column contains the treatment variable specifying the treatment groups.

treatmentCode

(optional) A string containing one of the factor levels from the treatment column. If provided, the corresponding treatment will be considered "Treatment 1". Otherwise, the first "level" of the column will be considered the primary treatment.

outcomeColName

A string containing the name of a column in data. The column contains the outcome variable to be compared between the treatment groups. If outcomeType = "survival", the outcome column holds the failure/censor assignments.

clusterVars

A character vector containing column names in data. Each column contains an X-variable, or covariate which will be used to form patient clusters.

labelColName

(optional) A string containing the name of a column from data. The column contains labels for each of the observations in data, defaults to the row indices.

numThreads

(optional) An integer value specifying the number of threads which will be assigned to the analysis. The maximum number of threads varies depending on the system hardware. Defaults to 1 thread.

radiusLevels

(optional) By default, Local Control builds a set of radii to fit data. The radiusLevels parameter allows users to override the construction by explicitly providing a set of radii.

radStepType

(optional) Used in the generation of correction radii. The step type used to generate each correction radius after the maximum. Currently accepts "unif" and "exp" (default). "unif" for uniform decay ex: (radDecayRate = 0.1) (1, 0.9, 0.8, 0.7, ..., ~minRadFract, 0) "exp" for exponential decay ex: (radDecayRate = 0.9) (1, 0.9, 0.81, 0.729, ..., ~minRadFract, 0)

radDecayRate

(optional) Used in the generation of correction radii. The size of the "step" between each of the generated correction radii. If radStepType == "exp", radDecayRate must be a value between (0,1). This value defaults to 0.8.

radMinFract

(optional) Used in the generation of correction radii. A floating point number representing the smallest fraction of the maximum radius to use as a correction radius.

normalize

(optional) Logical value. Tells local control if it should or should not normalize the covariates. Default is TRUE.

verbose

(optional) Logical value. Display or suppress the console output during the call to Local Control. Default is FALSE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
#input the abciximab study data of Kereiakes et al. (2000).
data(lindner)

linVars <- c("stent", "height", "female", "diabetic", "acutemi",
             "ejecfrac", "ves1proc")
results <- LocalControl(data = lindner,
                        clusterVars = linVars,
                        treatmentColName = "abcix",
                        outcomeColName = "cardbill",
                        treatmentCode = 1)

#Calculate the confidence intervals via resampling.
confResults = LocalControlNearestNeighborsConfidence(
                                        data = lindner,
                                        clusterVars = linVars,
                                        treatmentColName = "abcix",
                                        outcomeColName = "cardbill",
                                        treatmentCode = 1, nBootstrap = 20)

# Plot the local treatment difference with confidence intervals.
plot(results, confResults)

## End(Not run)

LocalControl documentation built on May 2, 2019, 7:29 a.m.