Learn R Programming

SurrogateRank (version 2.2)

test.surrogate: Tests whether the surrogate is valid

Description

Calculates the rank-based test statistic for Y and the rank-based test statistic for S and the difference, delta, along with corresponding standard error estimates, then tests whether the surrogate is valid

Usage

test.surrogate(full.data = NULL, yone = NULL, yzero = NULL, sone = NULL, 
szero = NULL, epsilon = NULL, power.want.s = 0.7, u.y.hyp = NULL)

Value

u.y

rank-based test statistic for Y

u.s

rank-based test statistic for S

delta

difference, u.y-u.s

sd.u.y

standard error estimate of u.y

sd.u.s

standard error estimate of u.s

sd.delta

standard error estimate of delta

ci.delta

1-sided confidence interval for delta

epsilon.used

the epsilon value used for the test

is.surrogate

logical, TRUE if test indicates S is a good surrogate, FALSE otherwise

Arguments

full.data

either full.data or yone, yzero, sone, szero must be supplied; if full data is supplied it must be in the following format: one observation per row, Y is in the first column, S is in the second column, treatment group (0 or 1) is in the third column.

yone

primary outcome, Y, in group 1

yzero

primary outcome, Y, in group 0

sone

surrogate marker, S, in group 1

szero

surrogate marker, S, in group 0

epsilon

threshold to use for delta, default calculates epsilon as a function of desired power for S

power.want.s

desired power for S, default is 0.7

u.y.hyp

hypothesized value of u.y used in the calculation of epsilon, default uses estimated valued of u.y

Author

Layla Parast

Examples

Run this code
data(example.data)
test.surrogate(yone = example.data$y1, yzero = example.data$y0, sone = example.data$s1, 
szero = example.data$s0)

Run the code above in your browser using DataLab