Description Usage Arguments Value Functions Examples
Sensitivity analysis for observational studies
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
A |
Indicator of missingness |
X |
A matrix of covariates |
Y |
Outcome |
gamma |
Sensitivity parameter (log odds ratio) |
alpha |
Significance level |
estimand |
Either "ate" (average treatment effect) or "att" (average treatment effect on the treated) |
reg.adjust |
Should regression adjustment (augmented IPW) be used? |
parallel |
Should parallel computing be used? |
B |
Number of Bootstrap resamples. |
warm.start |
Warm start the refitting of propensity score model (doesn't seem to help). |
start |
Starting values for the propensity score model to warm start |
A (1 - alpha) confidence interval.
Extrema (an interval).
extrema.os
: Obtain extrema of IPW estimator for observational studies
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Fish consumption and blood mercury dataset
require(CrossScreening)
data(nhanes.fish)
A <- as.numeric(nhanes.fish$fish.level == "high")
X <- nhanes.fish[, c("gender", "age", "income", "income.missing",
"race", "education", "smoking.ever", "smoking.now")]
X$race <- factor(X$race)
X1 <- model.matrix(~ . - 1, X)
Y <- log2(nhanes.fish$o.LBXTHG)
## Assuming no unmeasure confounder (i.e. gamma = 0 or Gamma = e^0 = 1)
extrema.os(A, X1, Y) # point estimate
bootsens.os(A, X1, Y, parallel = FALSE) # confidence interval
## Sensitivity analysis (gamma = 1, i.e. Gamma = e^1)
extrema.os(A, X1, Y, gamma = 1) # point estimate
bootsens.os(A, X1, Y, gamma = 1, parallel = FALSE) # confidence interval
## Sensitivity analysis using regression adjustment (gamma = 1, i.e. Gamma = e^1)
extrema.os(A, X1, Y, gamma = 1, reg.adjust = TRUE) # point estimate
bootsens.os(A, X1, Y, gamma = 1, reg.adjust = TRUE, parallel = FALSE) # confidence interval
## Reproduce the results for matching
d <- nhanes.log2diff()$o.LBXTHG
require(sensitivitymw)
senmwCI(d, gamma = exp(1), alpha = 0.1, one.sided = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.