delta.estimate: Calculates treatment effect

Description Usage Arguments Details Value Author(s) Examples

View source: R/Functions_Rsurrogate.R

Description

This function calculates the treatment effect estimate, the difference in the average outcome in the treatment group minus the control group. This function is intended to be used for a fully observed continuous outcome. The user can also request a variance estimate, estimated using perturbating-resampling, and a 95% confidence interval. If a confidence interval is requested two versions are provided: a normal approximation based interval and a quantile based interval, both use perturbation-resampling.

Usage

1
2
delta.estimate(yone,yzero, var = FALSE, conf.int = FALSE, weight = NULL, 
weight.perturb = NULL)

Arguments

yone

numeric vector; primary outcome for treated observations.

yzero

numeric vector; primary outcome for control observations.

var

TRUE or FALSE; indicates whether a variance estimate for delta is requested, default is FALSE.

conf.int

TRUE or FALSE; indicates whether a 95% confidence interval for delta is requested, default is FALSE.

weight

a n1+n0 by x matrix of weights where n1 = length of yone and n0 = length of yzero, default is null; generally not supplied by use but only used by other functions.

weight.perturb

a n1+n0 by x matrix of weights where n1 = length of yone and n0 = length of yzero, default is null; generally used for confidence interval construction and may be supplied by user.

Details

Let Y^{(1)} and Y^{(0)} denote the primary outcome under the treatment and primary outcome under the control,respectively. The treatment effect, Δ, is the expected difference in Y^{(1)} compared to Y^{(0)}, Δ=E(Y^{(1)}-Y^{(0)}). We estimate Δ as

\hat{Δ} = n_1^{-1} ∑_{i=1}^{n_1} Y_{1i} - n_0^{-1} ∑_{i=1}^{n_0} Y_{0i}

where Y_{1i} is the observed primary outcome for person i in the treated group, Y_{0i} is the observed primary outcome for person i in the control group, and n_1 and n_0 are the number of individuals in the treatment and control group, respectively. Randomized treatment assignment is assumed throughout this package.

Variance estimation and confidence interval construction are performed using perturbation-resampling. Specifically, let ≤ft \{ V^{(b)} = (V_{11}^{(b)}, ...V_{1n_1}^{(b)}, V_{01}^{(b)}, ...V_{0n_0}^{(b)})^T, b=1,....,D \right \} be n \times D independent copies of a positive random variables V from a known distribution with unit mean and unit variance. Let

\hat{Δ}^{(b)} = \frac{ ∑_{i=1}^{n_1} V_{1i}^{(b)} Y_{1i}}{ ∑_{i=1}^{n_1} V_{1i}^{(b)}} - \frac{ ∑_{i=1}^{n_0} V_{0i}^{(b)} Y_{0i}}{ ∑_{i=1}^{n_0} V_{0i}^{(b)}}.

The variance of \hat{Δ} is obtained as the empirical variance of \{\hat{Δ}^{(b)}, b = 1,...,D\}. In this package, we use weights generated from an Exponential(1) distribution and use D=500. We construct two versions of the 95\% confidence interval for \hat{Δ}: one based on a normal approximation confidence interval using the estimated variance and another taking the 2.5th and 97.5th empirical percentiles of \hat{Δ}^{(b)}.

Value

A list is returned:

delta

the estimate, \hat{Δ}, described above.

var

the variance estimate of \hat{Δ}; if var = TRUE or conf.int = TRUE.

conf.int.normal

a vector of size 2; the 95% confidence interval for \hat{Δ} based on a normal approximation; if conf.int = TRUE.

conf.int.quantile

a vector of size 2; the 95% confidence interval for \hat{Δ} based on sample quantiles of the perturbed values, described above; if conf.int = TRUE.

Author(s)

Layla Parast

Examples

1
2
3

Rsurrogate documentation built on Nov. 14, 2021, 9:07 a.m.