scqe.2cfull: Stability controlled quasi-experiment (scqe) for 2 cohort...

Description Usage Arguments Value Examples

View source: R/functions.R

Description

This function returns the scqe estimates and confidence intervals for the 2 cohort case when the user inputs full data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
scqe.2cfull(
  post,
  treatment,
  outcome,
  delta,
  min_delta,
  max_delta,
  alpha = 0.05,
  ...
)

Arguments

post

Binary vector corresponding to T = 0,1 for each observation.

treatment

Binary or continuous vector corresponding (usually) to 0,1 (no treatment or treatment) for each observation.

outcome

Continuous vector representing the outcome for each observation.

delta

Single value or vector of possible values for change in average non-treatment outcome between cohorts (if applicable).

min_delta

Minimum delta. Optional, not used if delta is supplied.

max_delta

Maximum delta. Optional, not used if delta is supplied.

alpha

Numeric alpha for confidence interval (default is alpha = 0.05).

...

Extra optional arguments.

Value

scqe object of class "scqe." Returns results table for the 2 cohort, full data case.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(1234)
post = c(rep(0,100), rep(1,100))
tx = c(rep(0, 100), rbinom(n = 100, prob = 0.27, size = 1))
y = rbinom(n = 200, prob = 0.1 + 0.02 * post - 0.05 * tx, size = 1)

# Two cohorts, full data
scqe.2cohort.full = scqe(post = post, treatment = tx, outcome = y,
delta = seq(from = -0.1,to = 0.1, by = 0.05))
plot(scqe.2cohort.full)
summary(scqe.2cohort.full)

chadhazlett/scqe documentation built on May 18, 2021, 1:32 a.m.