Package 'VEwaning'

Title: Vaccine Efficacy Over Time
Description: Implements methods for inference on potential waning of vaccine efficacy and for estimation of vaccine efficacy at a user-specified time after vaccination based on data from a randomized, double-blind, placebo-controlled vaccine trial in which participants may be unblinded and placebo subjects may be crossed over to the study vaccine. The methods also allow adjustment for possible confounding via inverse probability weighting through specification of models for the trial entry process, unblinding mechanisms, and the probability an unblinded placebo participant accepts study vaccine: Tsiatis, A. A. and Davidian, M. (2021) <arXiv:2102.13103> .
Authors: Marie Davidian [aut], A.A. Tsiatis [aut], Shannon T. Holloway [aut, cre]
Maintainer: Shannon T. Holloway <[email protected]>
License: GPL-2
Version: 1.3
Built: 2025-01-07 03:13:32 UTC
Source: https://github.com/cran/VEwaning

Help Index


Plot Analysis Results

Description

Plot the Estimated Vaccine Efficacy

Usage

## S3 method for class 'VEwaning'
plot(x, y, ..., xlim)

Arguments

x

An object of class VEwaning. The object returned by a call to veWaning()

y

Ignored

...

Ignored

xlim

A numeric vector object. The minimum and maximum tau values to include in the plot.

Value

No return value, called to produce graphical elements.

Examples

data(veWaningData)

set.seed(1234)

ind <- sample(1:nrow(x = veWaningData), 2500, FALSE)

# NOTE: This sample size is chosen for example only -- larger data sets
# should be used.

res <- veWaning(data = veWaningData[ind,], 
                L = 52,  
                lag = 6,  
                modelGam1 = ~ X1+X2+A+A:X1+A:X2, 
                modelGam2 = ~ X1+X2, 
                modelEntry = ~ X1+X2, 
                modelPsiGam1 = ~ X1+X2, 
                modelPsiGam2 = ~ X1+X2, 
                gFunc = 'piece', 
                v = c(15,30))

plot(x = res)

Print Analysis Results

Description

Print the primary results of the analysis

Usage

## S3 method for class 'VEwaning'
print(x, ...)

Arguments

x

An object of class VEwaning. The object returned by a call to veWaning()

...

Ignored

Value

No return value, called to display key results.

Examples

data(veWaningData)

set.seed(1234)

ind <- sample(1:nrow(veWaningData), 2500)
# NOTE: This sample size is chosen for example only -- larger data sets
# should be used.

res <- veWaning(data = veWaningData[ind,], 
                L = 52,  
                lag = 6,  
                modelGam1 = ~ X1+X2+A+A:X1+A:X2, 
                modelGam2 = ~ X1+X2, 
                modelEntry = ~ X1+X2, 
                modelPsiGam1 = ~ X1+X2, 
                modelPsiGam2 = ~ X1+X2, 
                gFunc = 'piece', 
                v = c(15,30))

print(x = res)

Retrieve the Estimated Vaccine Efficacy

Description

Uses a prior veWaning() analysis to estimate the vaccine efficacy at the provided times since vaccination.

Usage

ve(x, taus)

Arguments

x

An object of class VEwaning. The object returned by a call to veWaning()

taus

A numeric vector object. The times since vaccination at which the vaccine efficacy is to be estimated.

Value

A matrix object. The first column contains the times since vaccination at which the estimates are provided; the second column contains estimated vaccine efficacy; and the third is the standard error.

Examples

data(veWaningData)

set.seed(1234)

ind <- sample(1:nrow(veWaningData), 2500)
# NOTE: This sample size is chosen for example only -- larger data sets
# should be used.

res <- veWaning(data = veWaningData[ind,], 
                L = 52,  
                lag = 6,  
                modelGam1 = ~ X1+X2+A+A:X1+A:X2, 
                modelGam2 = ~ X1+X2, 
                modelEntry = ~ X1+X2, 
                modelPsiGam1 = ~ X1+X2, 
                modelPsiGam2 = ~ X1+X2, 
                gFunc = 'piece', 
                v = c(20))

ve(x = res, taus = c(10,20,30,40,50))

Estimation of Vaccine Efficacy Ove Time

Description

Implements methods for inference on potential waning of vaccine efficacy and for estimation of vaccine efficacy at a user-specified time after vaccination based on data from a randomized, double-blind, placebo-controlled vaccine trial in which participants may be unblinded and placebo subjects may be crossed over to the study vaccine. The methods also allow adjustment for possible confounding via inverse probability weighting through specification of models for the trial entry process, unblinding mechanisms, and the probability an unblinded placebo participant accepts study vaccine. Tsiatis, A. A. and Davidian, M. (2021) <arXiv:2102.13103>

Usage

veWaning(
  data,
  L,
  ...,
  lag = 0,
  modelGam1 = NULL,
  modelGam2 = NULL,
  modelEntry = NULL,
  modelPsiGam1 = NULL,
  modelPsiGam2 = NULL,
  gFunc = NULL,
  v = NULL,
  minWgt = NULL,
  maxWgt = NULL,
  txName = "A",
  infectionTime = "U",
  entryTime = "E",
  Gamma = "Gam",
  unblindTime = "R",
  vaccinated = "Psi"
)

Arguments

data

A data.frame object containing all relevant data.

L

A numeric object. The analysis time.

...

Ignored. Used only to require named inputs.

lag

A numeric object. The lag time between the initial vaccine dose and full efficacy.

modelGam1

A formula object. The coxph model for Gamma = 1. The LHS is set as the appropriate Surv() object internally. If a LHS is provided, it is ignored.

modelGam2

A formula object. The coxph model for Gamma = 2. The LHS is set as the appropriate Surv() object internally. If a LHS is provided, it is ignored.

modelEntry

A formula object. The coxph model for entry times. The LHS is set as the appropriate Surv() object internally. If a LHS is provided, it is ignored.

modelPsiGam1

A formula object. The logistic model for vaccination for participants with Gamma = 1. If a LHS is provided, it is ignored.

modelPsiGam2

A formula object. The logistic model for vaccination for participants with Gamma = 2. If a LHS is provided, it is ignored.

gFunc

A character object. The model of infection rates. Must be one of {'lin', 'piece', 'splin', 'spcub'} for the linear, piecewise constant, linear spline, and cubic spline models respectively

v

A numeric vector. The knots or cut-offs to be used by gFunc. If gFunc = 'lin', this input is ignored. For 'splin' and 'spcub', this is the knots of the spline on (0,L). For 'piece', v is the cut-offs on (0,L). Note that this input should not include the extremes 0 and L.

minWgt

A numeric object. If not NULL, the minimum non-zero value a weight can have, i.e., weight = max(minWgt, weight). If NULL, no truncation of weights is performed.

maxWgt

A numeric object. If not NULL, the maximum value a weight can have, i.e., weight = min(maxWgt, weight). If NULL, no truncation of weights is performed.

txName

A character object. The header of the column of data containing the treatment variable. Default value is 'A'. Treatment must be coded as 0/1, where 1 indicates that participant was vaccinated; 0 otherwise.

infectionTime

A character object. The header of the column of data containing the time of infection on the scale of the calendar time. Default value is 'U'.

entryTime

A character object. The header of the column of data containing the time of entry into the study on the scale of the calendar time. Default value is 'E'.

Gamma

A character object. The header of the column of data containing the category for the unblinding dynamic. Default value is 'Gam'. Data must be 0/1/2, where 0 indicates infection occurs before requested/ offered unblinding; 1 indicates unblinding was requested by participant prior to the commencement of participant decision clinic visits; and 2 indicates that unblinding occurred after the commencement of participant decision clinic visits

unblindTime

A character object. The header of the column of data containing the time to requested unblinding, participant decision clinic visit/requested unblinding, or infection, whichever comes first. Default value is 'R'.

vaccinated

A character object. The header of the column of data containing the indicator of vaccination, where 1 if participant is vaccinated; 0 otherwise. Default value is 'Psi'.

Details

Note the infection time, U, can take values NA or a value > L if the participant did not become infected. All other data must be complete.

The returned S3 object has 4 attributes needed for post-processing tools ve() and plot(). Specifically, "gFunc" is a character object specifying the model selected for the infection rate (input gFunc); "v", the knots or cut-offs to be used by gFunc (input v); "maxTau", the maximum vaccination time included in the analysis; and "lag", the lag time between the initial vaccine dose and full efficacy.

Value

A an S3 object of class "VEwaning", which comprises a list object containing

theta

A vector object containing the estimated theta parameters.

cov

The covariance estimated using the sandwich estimator.

SE

The standard error estimated using the sandwich estimator.

and attributes "gFunc", "maxTau", "lag", and "v", which store details of the original analysis that are required for post-processing convenience functions ve() and plot(). See details for further information.

References

Tsiatis, A. A. and Davidian, M. (2021) Estimating Vaccine Efficacy Over Time After a Randomized Study is Unblinded. Submitted.

Examples

data(veWaningData)

set.seed(1234)

ind <- sample(1:nrow(veWaningData), 2500)
# NOTE: This sample size is chosen for example only -- larger data sets
# should be used.

res <- veWaning(data = veWaningData[ind,], 
                L = 52,  
                lag = 6,  
                modelGam1 = ~ X1+X2+A+A:X1+A:X2, 
                modelGam2 = ~ X1+X2, 
                modelEntry = ~ X1+X2, 
                modelPsiGam1 = ~ X1+X2, 
                modelPsiGam2 = ~ X1+X2, 
                gFunc = 'piece', 
                v = c(15,30))

Toy Dataset For Illustration

Description

This data set is provided for the purposes of illustrating the use of the software.

Usage

data(veWaningData)

Format

veWaningData is a data.frame containing 30,000 participants The data.frame contains 8 columns,

X1

A dichotomous baseline covariate; generated from B(0.5).

X2

A continuous baseline covariates; generated from N(45,10^2).

E

The entry time into the study.

A

The indicator of vaccination at entry (1 = vaccinated at entry; 0 = not vaccinated)

U

The time to infection; NA if participant did not become infected.

R

Time to unblinding.

Gam

The dynamic under which unblinding occurred; 0: infection occurred prior to unblinding; 1: participant requested unblinding prior to study defined unblinding period; 2: participant was unblinded during the study defined unblinding period.

Psi

Indicator of whether subject received vaccination at time of unblinding (1: received vaccination at time R, 0 otherwise).