Rank Preserving Structural Failure Time Models

Implements methods described by the paper Robins and Tsiatis (1991) . These use g-estimation to estimate the causal effect of a treatment in a two-armed randomised control trial where non-compliance exists and is measured, under an assumption of an accelerated failure time model and no unmeasured confounders.

Travis-CI Build Status codecov AppVeyor Build Status CRAN version downloads

This is an R package that implements the method of Rank Preserving Strucutural Failure Time models to estimate causal effects in failure time models in randomised control trials where participants do not comply with the treatment assigned.

As an example:

fit <- rpsftm(Surv(progyrs, prog)~rand(imm,1-xoyrs/progyrs), data = immdef, censor_time = censyrs)
#>   arm   rx.Min. rx.1st Qu. rx.Median   rx.Mean rx.3rd Qu.   rx.Max.
#> 1   0 0.0000000  0.0000000 0.0000000 0.1574062  0.2547779 0.9770941
#> 2   1 1.0000000  1.0000000 1.0000000 1.0000000  1.0000000 1.0000000
#>         Length Class      Mode   
#> psi        1   -none-     numeric
#> fit       14   survfit    list   
#> CI         2   -none-     numeric
#> Sstar   1000   Surv       numeric
#> rand    2000   rand       numeric
#> ans        5   -none-     list   
#> eval_z     2   data.frame list   
#> n          2   table      numeric
#> obs        2   -none-     numeric
#> exp        2   -none-     numeric
#> var        4   -none-     numeric
#> chisq      1   -none-     numeric
#> call       4   -none-     call   
#> formula    3   terms      call   
#> terms      3   terms      call   
#> psi: -0.1810871
#> exp(psi): 0.8343627
#> Confidence Interval, psi -0.3496948 0.002042503
#> Confidence Interval, exp(psi)  0.7049032 1.002045

The main function is rpsftm which returns an object that has print, summary, and plot S3 methods.

See the vignette rpsftm_vignette for further details, explanation and examples.


rpsftm 1.2.5

Following an update to the survival package, the print.summary for objects fitted with coxph(), now does not report the R-squared statistic. Also the names of the modified copies of print and summary methods have been changed to include "rpsftm." and a new class created internally, so as to be more explicit and avoid masking the methods from the survival package.

rpsftm 1.2.4

Small modifications to get 100% coverage of the tests.

rpsftm 1.2.3

Minor aesthetic corrections to ensure that the print() and summary() output finishes with a new line.

rpsftm 1.2.2

modified the vignette to conditionally load the package "tableone", or use summary() as an alternative. Tableone package has been archived and so the CRAN checks are failing.

rpsftm 1.2.1

Ensuring forward compatibility with testthat package v2.0.0 .

rpsftm 1.2.0

Defined a class "rand" for rand() output;added a print method that gives summary of rx values by arm; exported rand and print.rand, modified rpsftm to return the rand() object, and the print.rpsftm, and print.summary methods to print the rand()

added an example to the plot.rpsftm documentation to illustrate how to modify the ggplot2 object. Standardised the underlying data.frame to have lower-case variable names. Modified the call to survfit() in rpsftm to use the same alpha argument (original set for CI around psi), but for the KM curves.

made the returned object inherit from survreg/coxph/survdiff as appopriate. Moved the returned object from the survival objects directly into the returned list rather than nested, with modified formula, terms, and call elements. Modified the print and summary methods. Hence standard methods are availble: anova, extractIAC, logLik, model.frame, model.matrix, predict, residuals, vcov.

added checks on the treat_modifier values: fail if they are all zero, and warn if not all strictly positive.

replaced uniroot with rootSolve::uniroot.all, to deal with multiple roots.

added in methods for residuals.rpsftm and survfit.rpsftm - essentially just calling the "inner" fitted model as needed. This allows cox.zph to be used.

modified the vignette to improve clarity

change the internal use of variable names arm and rx, to .arm and .rx and put in checks for these terms, and "time" "status" in the adjusting formula.

rpsftm 1.1.0

removed rows for "arm" from the print and summary methods for coxph and survreg fits.

clarified the documentation for rpsftm function arguments slightly.

Created a tools directory and put a copy of the image file in it for the Readme file. Left the original in the root directory, for github, which is ignored in the .Rbuildignore file. Following the instructions below.

It was recently pointed out to us that some README.html files (generated from the corresponding README.md ones) on the CRAN package web pages are incomplete, missing 'local' images not available from the web page and in most cases actually not even shipped with the package. This clearly should be changed, so we will move to using '--self-contained' for the pandoc conversion to ensure that the README.html files are "complete". Of course, this implies that all 'local' images used in README.md are needed in the package sources. If the images are also used for vignettes or Rd files, you can put them in the 'vignettes' or 'man/figures' directories. Otherwise, please put them in the top-level 'tools' directory, or a subdirectory of it. The CRAN incoming checks in r-devel were changed to perform the pandoc conversion checks with '--self-contained', and hence will warn about missing images.

Trying to recreate and resolve "bug" in (#2) for NA handling in the rand() function. test_errors.R revised.

added a link to https://codecov.io/ for continuous cloud testing of the coverage properties of the testing suite. (#3)

added a link to https://ci.appveyor.com/ for continuous building in a windows environment (#3)

edited the .travis.yml to send alerts on commits with the results (#3)

rpsftm 1.0.2

adding "@keywords internal" to the documentation of functions that are not exported; this will lessen the visibility of the functions in the documentation to avoid confusion to users.

rpsftm 1.0.1

Minor Changes

  • adding details of all contributors to the DESCRIPTION page.

rpsftm 1.0.0

This was the first release.

Reference manual

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


1.2.7 by Simon Bond, a year ago

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

Authors: Simon Bond [aut, cre] (primary author of code , secondary author of vignette) , Annabel Allison [aut] (primary author of vignette , secondary author of code)

Documentation:   PDF Manual  

GPL-2 license

Imports survival, ggplot2, stats

Suggests testthat, knitr, rmarkdown, tableone

See at CRAN