Generated Effect Modifier

An implementation of the generated effect modifier (GEM) method. This method constructs composite variables by linearly combining pre-treatment scalar patient characteristics to create optimal treatment effect modifiers in linear models. The optimal linear combination is called a GEM. Treatment is assumed to have been assigned at random. For reference, see E Petkova, T Tarpey, Z Su, and RT Ogden. Generated effect modifiers (GEMs) in randomized clinical trials. Biostatistics (First published online: July 27, 2016, ).


Aimed at generating optimal treatment effect modifiers for RCT, pre-treatment scalar patient characteristics are linearly combined as a Generated Effect Modifier (GEM). This package gives functions for

  • constructing the GEM

  • simulating three types of data set

  • calculating the population average benefit of a GEM model for a data set

  • calculating the effect size of a single moderator

  • calculating the permutation p-value of a GEM

See more detail in: E Petkova, T Tarpey, Z Su, and RT Ogden. Generated effect modifiers (GEMs) in randomized clinical trials. Biostatistics, (First published online: July 27, 2016). doi: 10.1093/biostatistics/kxw035.

You can install:

  • the latest released version from CRAN with

    install.packages("pirate")
  • the latest development version from github with

    if (packageVersion("devtools") < 1.6) {
      install.packages("devtools")
    }
    devtools::install_github("suzhesuzhe/GEM")

library(pirate) will load the core packages.

  • For fitting the GEM model with your own data set, please use gem_fit function and make sure the data frame is organized with first column as the treatment index, second column as the outcome, and the remaining columns as the covariates. One of the three methods could be choose and the default method is F-statistics.

    model <- gem_fit(dat = dat, method = "nu")

    You could get the permutation p-value of the GEM model by:

    permute_pvalue(dat,method = "nu")
  • For simulating data set, please refer to the 'data_generators' help page to get detailed information about each data generator.

    co <- matrix(0.2, 30, 30)
    diag(co) <- 1
    #simulate GEM type data set
    dataEx <- data_generator1(d = 0.3, R2 = 0.5, v2 = 1, n = 3000, 
                            co = co, beta1 = rep(1,30), inter = c(0,0))
     
    #simulate unconstrained data set with obeservation under both treatment and without error
    bigData <- data_generator3(n = 10000, co = co, bet = dataEx[[2]], inter = c(0,0))
  • For calculating the population average benefit under a GEM fit, the gemObject should be the second element of the ouput from the gem_fit function or a list with the same structure. please refer to the 'gem_test' help page to get detailed information about two test functions.

    #dat has outcome under only one treatment
    gem_test_sample(dat, model[[2]])
    #dat with outcome under both treatment 
    gem_test_simsample(bigData[[1]], bigData[[2]], bigData[[3]], model[[2]])

For questions and other discussion, please email zhe.su@nyumc.org.

News

This is a newly released package.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("pirate")

1.0.0 by Zhe Su, a year ago


Browse source code at https://github.com/cran/pirate


Authors: Eva Petkova, Zhe Su


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports plyr, MASS, ggplot2, Rcpp, RcppArmadillo

Suggests rmarkdown

Linking to Rcpp, RcppArmadillo


See at CRAN