bootsens.os: Sensitivity analysis for observational studies

Description Usage Arguments Value Functions Examples

View source: R/ipw.R

Description

Sensitivity analysis for observational studies

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
bootsens.os(
  A,
  X,
  Y,
  gamma = 0,
  alpha = 0.05,
  estimand = c("ate", "att"),
  reg.adjust = FALSE,
  parallel = FALSE,
  B = 1000,
  warm.start = FALSE
)

extrema.os(
  A,
  X,
  Y,
  gamma = 0,
  estimand = c("ate", "att"),
  reg.adjust = FALSE,
  start = NULL
)

Arguments

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 glm.

Value

A (1 - alpha) confidence interval.

Extrema (an interval).

Functions

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
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)

qingyuanzhao/bootsens documentation built on Jan. 17, 2021, 7:40 p.m.