Learn R Programming

SurrogateParadoxTest (version 2.0)

modified_S_stat: Helper function for non-negative residual treatment effect test.

Description

Calculates the value of the test statistic in the NNR test.

Usage

modified_S_stat(mu0_hat, mu1_hat, s0, y0, s1, y1, grid_x, boot = FALSE)

Value

s_hat

Value of the test statistic

sup

Value of the supremum over grid_x

Arguments

mu0_hat

Kernel-smoothed estimate of \(\mu_0\) function.

mu1_hat

Kernel-smoothed estimate of \(\mu_1\) function.

s0

Vector of surrogate values in control group.

y0

Vector of endpoint values in control group.

s1

Vector of surrogate values in treatment group.

y1

Vector of endpoing values in the treatment group.

grid_x

Values of s over which supremum is calculated.

boot

Whether this is a bootstrapped statistic or the test statistic.

Author

Emily Hsiao