Skip to contents

Performs analyses for the Triangulation WIthin A STudy (TWIST) framework to calcuate the ‘genetically moderated treatment effect’ (GMTE) for a time-to-event Aalen additive hazards model. The gmte_aalen function returns an object of class twistR_GMTE, containing effect estimates from the individual tests (such as RGMTE) and the results when combinations are performed (such as RGMTE+MR).

Usage

gmte_aalen(
  Y_t0,
  Y_t1,
  Y_d,
  T,
  G,
  Z,
  D,
  Nsim = 100,
  alpha = 0.05,
  verbose = FALSE
)

Arguments

Y_t0

Variable name (string) for when participants "enter" the model, which appears in data.frame D. When participants enter the model (can be all 0s if Y_t1 is time since start of exposure). Variable can be in date format from the as.Date() function, or numeric.

Y_t1

Variable name (string) for when participants "exit" the model, which appears in data.frame D. Either days since start of exposure period (numeric) or in date format from the as.Date() function.

Y_d

Variable name for the binary "event" variable (string) which appears in data.frame D.

T

The treatment variable name (string) which appears in data.frame D. Assumed to be binary.

G

The genotype variable name (string) which appears in data.frame D. Normally binary (e.g. comparing homozygous rare individuals to the rest of the population) but can be additive (0, 1, 2) or a score of multiple variants if desired.

Z

A string containing the model covariates to appear in the glm() models (for example "age+sex"). All need to be in data.frame D.

D

A data.frame containing the above variables.

Nsim

Number of simulations to perform in the aalen() models. Default is 100.

alpha

The p-value threshold for the chi-square test, estimating whether two estimates should be combined. Default is 0.05.

verbose

Return lots of output - useful for error checking. Default is FALSE.

Value

An object of class twistR_GMTE containing the following components:

CAT

The summary statistics from the Corrected As Treated (CAT) analysis.

GMTE1

The summary statistics from the GMTE(1) analysis (i.e. in the treated individuals).

GMTE0

The summary statistics from the GMTE(0) analysis (i.e. in the untreated individuals).

MR

The summary statistics from the MR analysis.

RGMTE

The summary statistics from the Robust GMTE analysis (GMTE1 corrected for GMTE0).

FullCombined

The combined summary statistics from all analyses performed, inclduing combinations.

References

Bowden, J., et al., The Triangulation WIthin A STudy (TWIST) framework for causal inference within Pharmacogenetic research. PLoS Genetics. https://doi.org/10.1371/journal.pgen.1009783

Author

Jack Bowden; Luke Pilling.

Examples

# Example using a time-to-event outcome (mortality), binary treatment (statins), and binary genotype (SLCO1B1*5 homozygotes) variables
Y_t0="date_first_statin"
Y_t1="date_of_death_or_censor"
Y_d="dead"
T="statin"
G="slco1b1_5_hmz"
Z="age+PC1+PC2+PC3+PC4+PC5+PC6+PC7+PC8+PC9+PC10"
results=gmte_aalen(Y_t0,Y_t1,Y_d,T,G,Z,D)
#> TWIST (Triangulation WIthin A STudy) analysis in R - Aalen additive hazards (time-to-event) model
#> Error in gmte_aalen(Y_t0, Y_t1, Y_d, T, G, Z, D): D needs to be a data.frame