GithubHelp home page GithubHelp logo

prise6 / avirtualtwins Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 2.0 174 KB

Adaptation of Virtual Twins method from Jared Foster

License: GNU General Public License v3.0

R 100.00%
rpackage r subgroup-identification trials

avirtualtwins's Introduction

aVirtualTwins

CRAN_Status_Badge

An adaptation of VirtualTwins method from Foster, J. C., Taylor, J. M.G. and Ruberg, S. J. (2011)

VirtualTwins is a method of subgroup identification from randomized clinical trial data.

In 2015, as an intern in a french pharmaceutical group, i worked on this method and develop a package based on Jared Foster and al method.

(Very) Quick Preview

# Load data
data(sepsis)
# Format data
vt.obj <- vt.data(dataset         = sepsis,
                  outcome.field   = "survival",
                  treatment.field = "THERAPY",
                  interactions    = TRUE)
# Print Incidences of sepsis data
vt.obj$getIncidences()
# $table
#            trt
# resp        0    1     sum  
#   0         101  188   289  
#   1         52   129   181  
#   sum       153  317   470  
#   Incidence 0.34 0.407 0.385
#
# $rr
# [1] 1.197059
#
# First step : create random forest model
vt.for <- vt.forest(forest.type  = "one",
                    vt.data      = vt.obj,
                    interactions = TRUE,
                    ntree        = 500)
# Second step : find rules in data 
vt.trees <- vt.tree(tree.type = "class",
                    vt.difft  = vt.for, 
                    threshold = quantile(vt.for$difft, seq(.5,.8,.1)),
                    maxdepth  = 2)
# Print results
vt.sbgrps <- vt.subgroups(vt.trees)
knitr::kable(vt.sbgrps)
Subgroup Subgroup size Treatement event rate Control event rate Treatment sample size Control sample size RR (resub) RR (snd)
tree1 PRAPACHE>=26.5 157 0.752 0.327 105 52 2.300 1.856
tree3 PRAPACHE>=26.5 & AGE>=51.74 120 0.897 0.31 78 42 2.894 1.991

## Infos

Currently this package works for RCT with two treatments groups and binary outcome.

Most of the package use Reference Class programing (in R). Feel free to create your own classes.

Of course, subgroup identification in general with two treatment and severals group can be possible.

Help & Documentation

See wiki tab.

Or:

vignette("full-example", package = "aVirtualTwins")

Or:

Here's a link to my intern dissertation (french version) La recherche de sous-groupes par Virtual Twins (parts V & VI).

Install

# use devtools library
library(devtools)
# install from github
devtools::install_github("prise6/aVirtualTwins", build_vignettes = TRUE)
# load library
library(aVirtualTwins)

To-do list

  • Link to my simulation
  • Submit to CRAN
  • Use R6 for perfs issues
  • Vignette on-line

News

See NEWS file

Contact

vieille.francois at gmail.com

avirtualtwins's People

Contributors

prise6 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

avirtualtwins's Issues

CRAN packages using undeclared packages in vignettes

CRAN wrote me with this issue to fix to maintain package :

From the 'NEWS' in R-devel

• R CMD check now also applies the settings of environment
  variables _R_CHECK_SUGGESTS_ONLY_ and _R_CHECK_DEPENDS_ONLY_ to
  the re-building of vignettes.

which enables more thorough checking of the manual's

All packages that are needed to successfully run R CMD check on the package must be listed in one of ‘Depends’ or ‘Suggests’ or ‘Imports’

R_CHECK_SUGGESTS_ONLY=true is part of -as-cran: see your package's CRAN results page (which will still be updating for this change).

The missing packages need to be declared in the Suggests: field -- there may be others missing since vignette re-building stops at the first error. You can confirm all needed packages used are declared by using 'R CMD check --as-cran' with current R-devel.

Where alternative vignette builders are used, some packages may also need to be declared in the VignetteBuilder: field:

The ‘VignetteBuilder’ field names (in a comma-separated list) packages that provide an engine for building vignettes. These may include the current package, or ones listed in ‘Depends’, ‘Suggests’ or ‘Imports’. The utils package is always implicitly appended. See Non-Sweave vignettes for details. Note that if, for example, the vignette ‘engine’ is ‘knitr::rmarkdown’ this field needs to declare both knitr and rmarkdown.

This includes any additional packages needed by the vignette builders (e.g. formatR, webshot).

predict function in a VirtualTwins

Hi Prise6,

Thank you for creating this great R package aVirtualTwins.
I'm using it to do simulation to compare those subgroup identification methods.
I was wondering if there's a way for me to predict the subgroups of a test sample based on the subgroups I got from the training sample? I checked VT.predict(), it seems that's for the randomforest result not vt.tree()'s.

Thank you in advance!

Regards,
Luxi

Sepsis dataset features meaning and origin

Dear Francois Vielle,

My name is Davide Chicco and I am a scientific associate researcher at the Peter Munk Cardiac Centre. I work on machine learning applied to health care, and I am especially
interested in sepsis prediction in patients.

I just discovered your aVirtualTwins project, and I downloaded the code and the dataset. The dataset looks very interesting to me, and I would like to know more about it.

Some questions:

1)) I just took a look at the features: "survival" "THERAPY"
"PRAPACHE" "AGE" "BLGCS" "ORGANNUM" "BLIL6" "BLLPLAT"
"BLLBILI" "BLLCREAT" "TIMFIRST" "BLADL" "blSOFA".
What is the meaning of these feature names?
Where can I find more information about them?

I found the description of these features in your thesis in French.

survival: 1 pour la survie au bout de 28 jours, 0 sinon
THERAPY: 1 pour le traitement actif, 0 pour le traitement de contrôle
TIMFIRST: Temps entre la prise de traitement et la défaillance du premier organe
AGE: Age du patient en années
BLLPLAT: Les plaquettes à baseline
blSOFA: Somme du sofa à baseline (score)
BLLCREAT: Créatinine à baseline
ORGANNUM: Nombre d'organes en défaillance à baseline
PRAPACHE: Score Pre-infusion Apache II
BLGCS: Echelle de Glasgow (état de conscience) à baseline
BLIL6: Concentration du serum IL-6 à baseline
BLADL: score Activity of daily
BLLBILI: Bilirubine à baseline

Can you please translate them into English please?

2)) What is the origin of this dataset?
Did you collect it from an hospital? Was it an online resource?

3)) Did you publish any scientific paper about this project?
If yes, can you please share it here?

Merci beaucoup, au revoir

-- Davide

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.