analyze_NEE: Analyze under NEE assumptions

Description Usage Arguments Value Examples

View source: R/analyze_NEE.R

Description

Analyze data assuming no early treatment effects

Usage

1
2
3
4
5
6
7
analyze_NEE(
  data,
  brange = 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

brange

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

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
Z <- rbinom(500, 1, 0.5)
S_star <- rbinom(500, 1, 0.2)
R <- rep(1, 500)
Y_tau <- rep(0, 500)
Y <- rbinom(500, 1, 0.1)
df <- data.frame(Z, S_star, R, Y_tau, Y)
analyze_NEE(df, c(-0.5, 0.5), design = "full", contrast = "VE")

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