Learn R Programming

doseSens (version 1.0.0)

sharp_null_double_test: Asymptotic sharp null sensitivity analysis for a class of test statistics accommodating continuous exposures and any scalar outcome.

Description

Asymptotic sharp null sensitivity analysis for a class of test statistics accommodating continuous exposures and any scalar outcome.

Usage

sharp_null_double_test(
  Z,
  R,
  index,
  gamma = 0,
  q1 = NA,
  q2 = NA,
  X = NA,
  stratum_weights = rep(NA, nostratum),
  conservative_variance = TRUE,
  double_rank = TRUE
)

Value

A list containing the deviate, one-sided p-value, observed value of the test statistic in each matched set, and conservative standard deviation estimate.

Arguments

Z

A length N vector of observed doses.

R

A length N vector of observed outcomes.

index

A length N vector of indices indicating matched set membership.

gamma

The nonnegative sensitivity parameter; gamma = 0 means no unmeasured confounding.

q1

A transformation to apply to the doses.

q2

A transformation to apply to the outcomes

X

A matrix with I rows and less than I columns that contains covariate information.

stratum_weights

A weight vector.

conservative_variance

Whether to use the conservative variance or not; default is TRUE.

double_rank

Whether to use the ranks of the transformed doses and outcomes; default is TRUE.

Examples

Run this code
# Load the data
data <- lead_bmd
# conduct sharp null test at gamma = 0.
result <- sharp_null_double_test(Z = data$log_lead,
R = -data$lumbar_spine_bmd, index = data$matched_sets, gamma = 0)

Run the code above in your browser using DataLab