analyze_NEH: Analyze under NEH assumptions

Description Usage Arguments Value Examples

View source: R/analyze_NEH.R

Description

Analyze data assuming no early treatment harm

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
analyze_NEH(
  data,
  brange0 = c(0, 0),
  brange1 = c(0, 0),
  brange2 = c(0, 0),
  brange3 = c(0, 0),
  design = "full",
  weights = NULL,
  contrast = "logRR"
)

Arguments

data

Data frame containing the following variables

  • Z: indicator of treatment

  • Y: indicator of outcome

  • Y_tau: indicator of early outcome

  • S_star: intermediate biomarker value

  • R: indicator of measurement of intermediate biomarker

brange0

Numeric (2 x 1) vector containing the specified lower and upper bounds of the range for sensitivity parameter β0

brange1

Numeric (2 x 1) vector containing the specified lower and upper bounds of the range for sensitivity parameter β1

brange2

Numeric (2 x 1) vector containing the specified lower and upper bounds of the range for sensitivity parameter β2

brange3

Numeric (2 x 1) vector containing the specified lower and upper bounds of the range for sensitivity parameter β3

design

String describing the study design / sampling scheme used. This allows for estimation of sampling weights. Options include "full", "cc" (case-cohort), and "other". When "other" is chosen the weights argument must also be specified

weights

Numeric (n x 1) vector containing pre-estimated sampling weights where n is the number of rows in data

contrast

Contrast function for estimand. Options include "logRR", "Difference", and "VE"

Value

Returns list consisting of 6 vectors corresponding to the ignorance intervals and EUIs of CEP(1, 0), CEP(0, 0), and the difference CEP(1, 0) - CEP(0, 0)

Examples

1
2
3
4
5
6
7
8
9
Z <- rbinom(500, 1, 0.5)
S_star <- rbinom(500, 1, 0.2)
R <- rep(1, 500)
Y_tau_1 <- rbinom(500, 1, 0.02)
Y_tau_0 <- Y_tau_1 + rbinom(500, 1, (1-Y_tau_1)*Z*0.02)
Y_tau <- Y_tau_0*(1-Z) + Y_tau_1*Z
Y <- Y_tau + (1 - Y_tau)*rbinom(500, 1, 0.1)
df <- data.frame(Z, S_star, R, Y_tau, Y)
analyze_NEH(df, c(-0.5, 0.5), design = "full", contrast = "VE")

bblette1/psbinary documentation built on June 18, 2021, 10:11 p.m.