normal_test_gen {doseSens} | R Documentation |
Sharp null sensitivity analysis for continuous exposures and binary outcomes using normal approximation.
Description
Sharp null sensitivity analysis for continuous exposures and binary outcomes using normal approximation.
Usage
normal_test_gen(
Z,
Q,
index,
gamma,
trans = identity,
weights = NA,
obsT = NULL,
direct = "upper"
)
Arguments
Z |
A length N vector of (nonnegative) observed doses. |
Q |
A length N vector of observed binary outcomes. |
index |
A length N vector of indices indicating matched set membership. |
gamma |
The nonnegative sensitivity parameter; gamma = 0 means no unmeasured confounding. |
trans |
The transformation of the doses to use for the test statistic. Default is the identity function. |
weights |
Weights to apply for the test statistic |
obsT |
The observed value of the test statistic; default is NULL. |
direct |
The direction of the test - "upper" or "lower"; default is upper. |
Value
A list containing the following:
obsT |
The observed value of the test statistic |
exp |
The worst-case expectation |
var |
The worst-case variance. |
deviate |
The normal approximation deviate. |
Examples
# Load the data
data <- treat_out_match
# Make a threshold at log(3.5) transformation function.
above = function(Z) { return(Z > log(3.5)) }
# Conduct randomization test using normal approximation.
solution <- normal_test_gen(data$treat, data$complain, data$match_ind,
gamma = 0, trans = above)