mirror of
https://github.com/prise6/aVirtualTwins.git
synced 2024-06-08 01:42:11 +02:00
commit
e78be83e6e
|
@ -4,3 +4,4 @@
|
|||
^draft$
|
||||
^NEWS$
|
||||
^cran-comments.md$
|
||||
^revdep$
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@
|
|||
.RData
|
||||
/drafts/*
|
||||
inst/doc
|
||||
/revdep/.cache.rds
|
||||
|
|
16
DESCRIPTION
16
DESCRIPTION
|
@ -1,11 +1,11 @@
|
|||
Package: aVirtualTwins
|
||||
Type: Package
|
||||
Title: Adaptation of Virtual Twins Method from Jared Foster
|
||||
Version: 1.0.0.9000
|
||||
Date: 2016-10-09
|
||||
Authors@R: person("Francois", "Vieille", email = "vieille.francois@gmail.com",
|
||||
role = c("aut", "cre"))
|
||||
Description: Research of subgroups in random clinical trials with binary outcome and two treatments groups. This is an adaptation of the Jared Foster method.
|
||||
Version: 1.0.1
|
||||
Date: 2018-02-03
|
||||
Authors@R: c(person("Francois", "Vieille", email = "vieille.francois@gmail.com",
|
||||
role = c("aut", "cre")), person("Jared", "Foster", email = "jared.foster@nih.gov", role = c("aut")))
|
||||
Description: Research of subgroups in random clinical trials with binary outcome and two treatments groups. This is an adaptation of the Jared Foster method (<https://www.ncbi.nlm.nih.gov/pubmed/21815180>).
|
||||
License: GPL-3 | file LICENSE
|
||||
URL: https://github.com/prise6/aVirtualTwins
|
||||
BugReports: https://github.com/prise6/aVirtualTwins/issues
|
||||
|
@ -18,7 +18,9 @@ Imports:
|
|||
Suggests:
|
||||
caret,
|
||||
knitr,
|
||||
rpart.plot
|
||||
rpart.plot,
|
||||
rmarkdown,
|
||||
e1071
|
||||
Depends:
|
||||
R (>= 3.2.0),
|
||||
Collate:
|
||||
|
@ -42,4 +44,4 @@ Collate:
|
|||
'tree.reg.R'
|
||||
'tree.wrapper.R'
|
||||
VignetteBuilder: knitr
|
||||
RoxygenNote: 5.0.1
|
||||
RoxygenNote: 6.0.1
|
||||
|
|
7
NEWS
7
NEWS
|
@ -1,3 +1,10 @@
|
|||
aVirtualTwins 1.0.1 (2018-01-30)
|
||||
----------------------------------------------------------------
|
||||
|
||||
* Fix CRAN warning : CRAN packages using undeclared packages in vignettes
|
||||
* waiting for submission approval
|
||||
|
||||
|
||||
aVirtualTwins 1.0.0.9000 (2016-10-10)
|
||||
----------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -10,15 +10,8 @@
|
|||
#' \code{\link{vt.tree}} is users function.
|
||||
#' }
|
||||
#'
|
||||
#' @section TODO LIST:
|
||||
#' \emph{last update : 27.07.2015}
|
||||
#' \itemize{
|
||||
#' \item More detailed documentation and vignettes
|
||||
#' \item Write examples
|
||||
#' \item ...
|
||||
#' }
|
||||
#'
|
||||
#' See github.com/prise6/aVirtualTwins for last updates.
|
||||
#' See http://github.com/prise6/aVirtualTwins for last updates.
|
||||
#'
|
||||
#' @docType package
|
||||
#' @name aVirtualTwins
|
||||
|
|
|
@ -32,23 +32,24 @@
|
|||
#' @return \code{VT.difft}
|
||||
#'
|
||||
#' @examples
|
||||
#' \dontrun{
|
||||
#' # data(sepsis)
|
||||
#'
|
||||
#' data(sepsis)
|
||||
#' vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
|
||||
#' # inside model :
|
||||
#' vt.f <- vt.forest("one", vt.o)
|
||||
#' # ...
|
||||
#' # your model :
|
||||
#' rf <- randomForest(y = vt.o$getY(),
|
||||
#' x = vt.o$getX(int = T),
|
||||
#' mtry = 3,
|
||||
#' nodesize = 15)
|
||||
#' vt.f <- vt.forest("one", vt.o, model = rf)
|
||||
#' # library(randomForest)
|
||||
#' # rf <- randomForest(y = vt.o$getY(),
|
||||
#' # x = vt.o$getX(int = T),
|
||||
#' # mtry = 3,
|
||||
#' # nodesize = 15)
|
||||
#' # vt.f <- vt.forest("one", vt.o, model = rf)
|
||||
#' # ...
|
||||
#' # Can also use ... parameters
|
||||
#' vt.f <- vt.forest("one", vt.o, mtry = 3, nodesize = 15)
|
||||
#' # ...
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#' @include forest.R difft.R
|
||||
#'
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
#' \dontrun{
|
||||
#' data.format <- formatRCTDataset(data, "outcome", "treatment", TRUE)
|
||||
#' }
|
||||
#' data(sepsis)
|
||||
#' data.format <- formatRCTDataset(sepsis, "survival", "THERAPY", T)
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
|
|
|
@ -13,10 +13,9 @@
|
|||
#' @param ... parameters of \code{\link{VT.object}}
|
||||
#'
|
||||
#' @examples
|
||||
#' \dontrun{
|
||||
#'
|
||||
#' data(sepsis)
|
||||
#' formatRCTdataset(sepsis, "survival", "THERAPY", T)
|
||||
#' }
|
||||
#' vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
|
||||
#'
|
||||
#' @return \code{VT.object}
|
||||
#'
|
||||
|
@ -25,6 +24,8 @@
|
|||
#' @name vt.data
|
||||
#'
|
||||
#' @export vt.data
|
||||
#'
|
||||
#' @seealso \code{\link{formatRCTDataset}}
|
||||
|
||||
vt.data <- function(dataset, outcome.field, treatment.field, interactions = TRUE, ...){
|
||||
data <- formatRCTDataset(dataset, outcome.field, treatment.field, interactions = TRUE)
|
||||
|
|
28
R/tools.R
28
R/tools.R
|
@ -18,18 +18,16 @@
|
|||
#' @return data.frame of rules
|
||||
#'
|
||||
#' @examples
|
||||
#' \dontrun{
|
||||
#' # data(sepsis)
|
||||
#' vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
|
||||
#' data(sepsis)
|
||||
#' vt.o <- vt.data(sepsis, "survival", "THERAPY", TRUE)
|
||||
#' # inside model :
|
||||
#' vt.f <- vt.forest("one", vt.o)
|
||||
#' # use classification tree
|
||||
#' vt.tr <- vt.tree("class", vt.f, threshold = c(0.01, 0.05))
|
||||
#' # show subgroups
|
||||
#' vt.subgroups(vt.tr)
|
||||
#' subgroups <- vt.subgroups(vt.tr)
|
||||
#' # change options you'll be surprised !
|
||||
#' vt.subgroups(vt.tr, verbose = T, tables = T)
|
||||
#' }
|
||||
#' subgroups <- vt.subgroups(vt.tr, verbose = TRUE, tables = TRUE)
|
||||
#'
|
||||
#' @export vt.subgroups
|
||||
#'
|
||||
|
@ -43,7 +41,7 @@ vt.subgroups <- function(vt.trees, only.leaf = T, only.fav = T, tables = F, verb
|
|||
unique(do.call(rbind, subgroups))
|
||||
}
|
||||
else{
|
||||
subgroups <- vt.tree$getRules(only.leaf = only.leaf, only.fav = only.fav, tables = tables, verbose = verbose, compete = compete)
|
||||
subgroups <- vt.trees$getRules(only.leaf = only.leaf, only.fav = only.fav, tables = tables, verbose = verbose, compete = compete)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,20 +61,26 @@ vt.getQAOriginal <- function(response, trt, ahat){
|
|||
|
||||
vt.getTable <- function(table){
|
||||
if(is.list(table)) table <- table[[1]]
|
||||
Incidence <- function(X) as.character(round(X[2] / X[3], digits = 3))
|
||||
Incidence <- function(X) round(X[2] / X[3], digits = 3)
|
||||
t <- stats::addmargins(table, margin = c(1,2), FUN = sum, quiet = T)
|
||||
t <- stats::addmargins(t, FUN = Incidence, margin = 1, quiet = T)
|
||||
rr <- as.numeric(t["Incidence", "1"]) / as.numeric(t["Incidence", "0"])
|
||||
rr <- NA_real_
|
||||
if(nrow(t) == 4) rr <- t[4, 2] / t[4, 1]
|
||||
return(list(table = t, rr = rr))
|
||||
}
|
||||
|
||||
vt.getIncidence <- function(df){
|
||||
if (nrow(df) == 0) table.res <- NULL
|
||||
if (ncol(df) != 2) table.res <- NULL
|
||||
else{
|
||||
table.res <- vt.getTable(table(df[, 1],
|
||||
df[, 2],
|
||||
table.res <- vt.getTable(
|
||||
table(
|
||||
factor(df[, 1], levels = c(0, 1)),
|
||||
factor(df[, 2], levels = c(0, 1)),
|
||||
deparse.level = 2,
|
||||
dnn = c("resp", "trt")))
|
||||
dnn = c("resp", "trt")
|
||||
)
|
||||
)
|
||||
}
|
||||
return(table.res)
|
||||
}
|
||||
|
|
20
R/tree.R
20
R/tree.R
|
@ -248,17 +248,17 @@ VT.tree <- setRefClass(
|
|||
|
||||
if(isTRUE(tables)){
|
||||
cat("\n")
|
||||
cat(sprintf("Incidence dans la selection \n"))
|
||||
cat(sprintf("Incidence in selection \n"))
|
||||
print(incid$table.selected$table)
|
||||
cat("\n")
|
||||
cat(sprintf("Risque relatif (resub) : %0.3f \n", incid$table.selected$rr))
|
||||
cat(sprintf("Risque relatif (snd) : %0.3f \n\n", incid$table.selected$rr.snd))
|
||||
cat(sprintf("Relative risk (resub) : %0.3f \n", incid$table.selected$rr))
|
||||
cat(sprintf("Relative risk (snd) : %0.3f \n\n", incid$table.selected$rr.snd))
|
||||
|
||||
cat(sprintf("Incidence dans le complementaire\n"))
|
||||
cat(sprintf("Incidence in complement\n"))
|
||||
print(incid$table.not.selected$table)
|
||||
cat("\n")
|
||||
cat(sprintf("Risque relatif (resub) : %0.3f \n", incid$table.not.selected$rr))
|
||||
cat(sprintf("Risque relatif (snd) : %0.3f \n\n", incid$table.not.selected$rr.snd))
|
||||
cat(sprintf("Relative risk (resub) : %0.3f \n", incid$table.not.selected$rr))
|
||||
cat(sprintf("Relative risk (snd) : %0.3f \n\n", incid$table.not.selected$rr.snd))
|
||||
}
|
||||
|
||||
cat("\n\n")
|
||||
|
@ -310,15 +310,15 @@ VT.tree <- setRefClass(
|
|||
table.A <- table.inc$table.selected
|
||||
table.A.cmpl <- table.inc$table.not.selected
|
||||
|
||||
cat(sprintf("Incidence dans le sous groupe A\n"))
|
||||
cat(sprintf("Incidence in subgroup A\n"))
|
||||
print(table.A$table)
|
||||
cat("\n")
|
||||
cat(sprintf("Risque relatif : %0.3f \n\n", table.A$risque_relatif))
|
||||
cat(sprintf("Relative risk : %0.3f \n\n", table.A$risque_relatif))
|
||||
|
||||
cat(sprintf("Incidence dans le sous groupe A complementaire\n"))
|
||||
cat(sprintf("Incidence in complement subgroup of A\n"))
|
||||
print(table.A.cmpl$table)
|
||||
cat("\n")
|
||||
cat(sprintf("Risque relatif : %0.3f \n\n", table.A.cmpl$risque_relatif))
|
||||
cat(sprintf("Relative risk : %0.3f \n\n", table.A.cmpl$risque_relatif))
|
||||
}else{
|
||||
return("Empty set")
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#' @export VT.tree.class
|
||||
#'
|
||||
#' @import methods
|
||||
#' @importFrom rpart rpart
|
||||
#'
|
||||
VT.tree.class <- setRefClass(
|
||||
Class = "VT.tree.class",
|
||||
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
#' dimension. See examples.
|
||||
#'
|
||||
#' @examples
|
||||
#' \dontrun{
|
||||
#' # data(sepsis)
|
||||
#' data(sepsis)
|
||||
#' vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
|
||||
#' # inside model :
|
||||
#' vt.f <- vt.forest("one", vt.o)
|
||||
|
@ -34,11 +33,12 @@
|
|||
#' # return a list
|
||||
#' class(vt.tr)
|
||||
#' # access one of the tree
|
||||
#' vt.tr$tree1
|
||||
#' tree1 <- vt.tr$tree1
|
||||
#' # return infos
|
||||
#' vt.tr$tree1$getInfos()
|
||||
#' # ...
|
||||
#' }
|
||||
#' # vt.tr$tree1$getInfos()
|
||||
#' # vt.tr$tree1$getRules()
|
||||
#' # use vt.subgroups tool:
|
||||
#' subgroups <- vt.subgroups(vt.tr)
|
||||
#'
|
||||
#' @include tree.R
|
||||
#'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# aVirtualTwins
|
||||
|
||||
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/aVirtualTwins)](http://cran.r-project.org/package=aVirtualTwins)
|
||||
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/aVirtualTwins)](https://cran.r-project.org/package=aVirtualTwins)
|
||||
|
||||
An adaptation of VirtualTwins method from [Foster, J. C., Taylor, J. M.G. and Ruberg, S. J. (2011)](http://onlinelibrary.wiley.com/doi/10.1002/sim.4322/abstract)
|
||||
|
||||
|
|
|
@ -1,3 +1,80 @@
|
|||
submission 4
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
## v1.0.1 : patch to cran fix minor issues:
|
||||
|
||||
* make checkable examples : fix subgroups example
|
||||
|
||||
## Test environments
|
||||
|
||||
* Linux, Debian jessie, R 3.4.3
|
||||
* win-builder (devel and release)
|
||||
|
||||
|
||||
## R CMD check result
|
||||
|
||||
Status: OK
|
||||
|
||||
R CMD check results
|
||||
0 errors | 0 warnings | 0 notes
|
||||
|
||||
|
||||
This is the third submission
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
## v1.0.1 : patch to cran fix minor issues:
|
||||
|
||||
* make checkable examples
|
||||
* update version date
|
||||
* add reference to Jared Foster article
|
||||
|
||||
## Test environments
|
||||
|
||||
* Linux, Debian jessie, R 3.4.3
|
||||
* win-builder (devel and release)
|
||||
|
||||
|
||||
## R CMD check result
|
||||
|
||||
Status: OK
|
||||
|
||||
R CMD check results
|
||||
0 errors | 0 warnings | 0 notes
|
||||
|
||||
|
||||
|
||||
This is the second submission
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
## v1.0.1 : patch to cran warning:
|
||||
|
||||
>CRAN packages using undeclared packages in vignettes
|
||||
|
||||
`rmarkdown` seems to be the issue. Added `rmarkdown` to suggest field.
|
||||
`e1071` was added too.
|
||||
|
||||
## Test environments
|
||||
|
||||
* Linux, Debian jessie, R 3.4.3
|
||||
* win-builder (devel and release)
|
||||
|
||||
|
||||
## R CMD check result
|
||||
|
||||
Status: OK
|
||||
|
||||
R CMD check results
|
||||
0 errors | 0 warnings | 0 notes
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
This is the first submission
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
|
|
@ -33,13 +33,14 @@ So \emph{absolute} method is :
|
|||
|
||||
\item{\code{difft}}{vector of difference between twin1 and twin2}
|
||||
}}
|
||||
|
||||
\section{Methods}{
|
||||
|
||||
\describe{
|
||||
\item{\code{computeDifft()}}{Compute difference between twin1 and twin2. See details.}
|
||||
}}
|
||||
|
||||
\seealso{
|
||||
\code{\link{VT.forest}}, \code{\link{VT.forest.one}},
|
||||
\code{\link{VT.forest.double}}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ An abstract reference class to compute twin via random forests
|
|||
\describe{
|
||||
\item{\code{...}}{see fields of \code{\link{VT.difft}}}
|
||||
}}
|
||||
|
||||
\section{Methods}{
|
||||
|
||||
\describe{
|
||||
|
@ -23,7 +24,7 @@ An abstract reference class to compute twin via random forests
|
|||
|
||||
\item{\code{run()}}{Compute twin1 and twin2 estimation. Switch treatment if necessary.}
|
||||
}}
|
||||
|
||||
\seealso{
|
||||
\code{\link{VT.difft}}, \code{\link{VT.forest.one}}, \code{\link{VT.forest.double}}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ This is what \code{computeTwin2()} does.
|
|||
|
||||
\item{\code{...}}{field from parent class : \code{\link{VT.forest}}}
|
||||
}}
|
||||
|
||||
\section{Methods}{
|
||||
|
||||
\describe{
|
||||
|
@ -38,8 +39,8 @@ This is what \code{computeTwin2()} does.
|
|||
|
||||
\item{\code{computeTwin2()}}{Compute twin2 by the other part of data in the other forest. See details.}
|
||||
}}
|
||||
|
||||
\seealso{
|
||||
\code{\link{VT.difft}}, \code{\link{VT.forest}},
|
||||
\code{\link{VT.forest.one}}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,13 +28,14 @@ interactions}
|
|||
|
||||
\item{\code{...}}{field from parent class : \code{\link{VT.forest}}}
|
||||
}}
|
||||
|
||||
\section{Methods}{
|
||||
|
||||
\describe{
|
||||
\item{\code{run()}}{Compute twin1 and twin2 estimation. Switch treatment if necessary.}
|
||||
}}
|
||||
|
||||
\seealso{
|
||||
\code{\link{VT.difft}}, \code{\link{VT.forest}},
|
||||
\code{\link{VT.forest.one}}, \code{\link{VT.forest.double}}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ what \code{computeTwin1()} and \code{computeTwin2()} functions do.
|
|||
|
||||
\item{\code{...}}{field from parent class : \code{\link{VT.forest}}}
|
||||
}}
|
||||
|
||||
\section{Methods}{
|
||||
|
||||
\describe{
|
||||
|
@ -31,7 +32,7 @@ what \code{computeTwin1()} and \code{computeTwin2()} functions do.
|
|||
|
||||
\item{\code{computeTwin2()}}{Compute twin2 by switching treatment and applying random forest model}
|
||||
}}
|
||||
|
||||
\seealso{
|
||||
\code{\link{VT.difft}}, \code{\link{VT.forest}}, \code{\link{VT.forest.double}}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ treatments.}
|
|||
\item{\code{type}}{Character : binary or continous. Only binary is currently
|
||||
available.}
|
||||
}}
|
||||
|
||||
\section{Methods}{
|
||||
|
||||
\describe{
|
||||
|
@ -53,6 +54,7 @@ If trt is not NULL, return predictors for T = trt}
|
|||
|
||||
\item{\code{switchTreatment()}}{Switch treatment value.}
|
||||
}}
|
||||
|
||||
\examples{
|
||||
\dontrun{
|
||||
# Default use :
|
||||
|
@ -78,4 +80,3 @@ vt.o$getIncidences()
|
|||
\seealso{
|
||||
\code{\link{VT.difft}}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
\docType{methods}
|
||||
\name{VT.predict}
|
||||
\alias{VT.predict}
|
||||
\alias{VT.predict,RandomForest,data.frame,character-method}
|
||||
\alias{VT.predict,RandomForest,missing,character-method}
|
||||
\alias{VT.predict,randomForest,data.frame,character-method}
|
||||
\alias{VT.predict,RandomForest,data.frame,character-method}
|
||||
\alias{VT.predict,randomForest,missing,character-method}
|
||||
\alias{VT.predict,randomForest,data.frame,character-method}
|
||||
\alias{VT.predict,train,ANY,character-method}
|
||||
\alias{VT.predict,train,missing,character-method}
|
||||
\title{VT.predict generic function}
|
||||
|
|
|
@ -52,6 +52,7 @@ screening field}
|
|||
|
||||
\item{\code{Ahat}}{vector Indicator of beglonging to Ahat}
|
||||
}}
|
||||
|
||||
\section{Methods}{
|
||||
|
||||
\describe{
|
||||
|
@ -74,7 +75,7 @@ screening field}
|
|||
|
||||
\item{\code{run(...)}}{Compute tree with rpart parameters}
|
||||
}}
|
||||
|
||||
\seealso{
|
||||
\code{\link{VT.tree.reg}}, \code{\link{VT.tree.class}}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
\name{aVirtualTwins}
|
||||
\alias{aVirtualTwins}
|
||||
\alias{aVirtualTwins-package}
|
||||
\alias{aVirtualTwins-package}
|
||||
\title{aVirtualTwins : An adapation of VirtualTwins method created by Jared Foster.}
|
||||
\description{
|
||||
aVirtualTwins is written mainly with reference classes. Briefly, there is three kinds of class :
|
||||
|
@ -15,15 +16,6 @@ aVirtualTwins is written mainly with reference classes. Briefly, there is three
|
|||
\code{\link{vt.tree}} is users function.
|
||||
}
|
||||
}
|
||||
\section{TODO LIST}{
|
||||
|
||||
\emph{last update : 27.07.2015}
|
||||
\itemize{
|
||||
\item More detailed documentation and vignettes
|
||||
\item Write examples
|
||||
\item ...
|
||||
\details{
|
||||
See http://github.com/prise6/aVirtualTwins for last updates.
|
||||
}
|
||||
|
||||
See github.com/prise6/aVirtualTwins for last updates.
|
||||
}
|
||||
|
||||
|
|
|
@ -37,10 +37,12 @@ running VirtualTwins with interaction, it creates dummy variables.
|
|||
}
|
||||
\examples{
|
||||
\dontrun{
|
||||
data.format <- formatRCTDataset(data, "outcome", "treatment", TRUE)
|
||||
data.format <- formatRCTDataset(data, "outcome", "treatment", TRUE)
|
||||
}
|
||||
data(sepsis)
|
||||
data.format <- formatRCTDataset(sepsis, "survival", "THERAPY", T)
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -43,4 +43,3 @@ True subgroup is \emph{PRAPACHE <= 26 & AGE <= 49.80}. \emph{NOTE:} This
|
|||
subgroup is defined with the \emph{lower} event rate (survival = 1) in
|
||||
treatement arm.
|
||||
}
|
||||
|
||||
|
|
|
@ -27,10 +27,11 @@ interactions, set to TRUE (default value)}
|
|||
a VT.object object.
|
||||
}
|
||||
\examples{
|
||||
\dontrun{
|
||||
data(sepsis)
|
||||
formatRCTdataset(sepsis, "survival", "THERAPY", T)
|
||||
}
|
||||
|
||||
data(sepsis)
|
||||
vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
|
||||
|
||||
}
|
||||
|
||||
\seealso{
|
||||
\code{\link{formatRCTDataset}}
|
||||
}
|
||||
|
|
|
@ -50,23 +50,23 @@ Is only used with forest.type = "fold". Default to 5. See
|
|||
parameter forest.type, any of these class can be used with its own parameter.
|
||||
}
|
||||
\examples{
|
||||
\dontrun{
|
||||
# data(sepsis)
|
||||
vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
|
||||
# inside model :
|
||||
vt.f <- vt.forest("one", vt.o)
|
||||
# ...
|
||||
# your model :
|
||||
rf <- randomForest(y = vt.o$getY(),
|
||||
x = vt.o$getX(int = T),
|
||||
mtry = 3,
|
||||
nodesize = 15)
|
||||
vt.f <- vt.forest("one", vt.o, model = rf)
|
||||
# ...
|
||||
# Can also use ... parameters
|
||||
vt.f <- vt.forest("one", vt.o, mtry = 3, nodesize = 15)
|
||||
# ...
|
||||
}
|
||||
|
||||
data(sepsis)
|
||||
vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
|
||||
# inside model :
|
||||
vt.f <- vt.forest("one", vt.o)
|
||||
# ...
|
||||
# your model :
|
||||
# library(randomForest)
|
||||
# rf <- randomForest(y = vt.o$getY(),
|
||||
# x = vt.o$getX(int = T),
|
||||
# mtry = 3,
|
||||
# nodesize = 15)
|
||||
# vt.f <- vt.forest("one", vt.o, model = rf)
|
||||
# ...
|
||||
# Can also use ... parameters
|
||||
vt.f <- vt.forest("one", vt.o, mtry = 3, nodesize = 15)
|
||||
# ...
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -32,18 +32,15 @@ Function which uses \code{\link{VT.tree}} intern functions. Package
|
|||
rpart.plot must be loaded. See \code{\link{VT.tree}} for details.
|
||||
}
|
||||
\examples{
|
||||
\dontrun{
|
||||
# data(sepsis)
|
||||
vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
|
||||
# inside model :
|
||||
vt.f <- vt.forest("one", vt.o)
|
||||
# use classification tree
|
||||
vt.tr <- vt.tree("class", vt.f, threshold = c(0.01, 0.05))
|
||||
# show subgroups
|
||||
vt.subgroups(vt.tr)
|
||||
# change options you'll be surprised !
|
||||
vt.subgroups(vt.tr, verbose = T, tables = T)
|
||||
}
|
||||
data(sepsis)
|
||||
vt.o <- vt.data(sepsis, "survival", "THERAPY", TRUE)
|
||||
# inside model :
|
||||
vt.f <- vt.forest("one", vt.o)
|
||||
# use classification tree
|
||||
vt.tr <- vt.tree("class", vt.f, threshold = c(0.01, 0.05))
|
||||
# show subgroups
|
||||
subgroups <- vt.subgroups(vt.tr)
|
||||
# change options you'll be surprised !
|
||||
subgroups <- vt.subgroups(vt.tr, verbose = TRUE, tables = TRUE)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -39,21 +39,20 @@ See \code{\link{VT.tree}}, \code{\link{VT.tree.class}} and
|
|||
\code{\link{VT.tree.reg}} classes.
|
||||
}
|
||||
\examples{
|
||||
\dontrun{
|
||||
# data(sepsis)
|
||||
vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
|
||||
# inside model :
|
||||
vt.f <- vt.forest("one", vt.o)
|
||||
# use classification tree
|
||||
vt.tr <- vt.tree("class", vt.f, threshold = c(0.01, 0.05))
|
||||
# return a list
|
||||
class(vt.tr)
|
||||
# access one of the tree
|
||||
vt.tr$tree1
|
||||
# return infos
|
||||
vt.tr$tree1$getInfos()
|
||||
# ...
|
||||
}
|
||||
data(sepsis)
|
||||
vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
|
||||
# inside model :
|
||||
vt.f <- vt.forest("one", vt.o)
|
||||
# use classification tree
|
||||
vt.tr <- vt.tree("class", vt.f, threshold = c(0.01, 0.05))
|
||||
# return a list
|
||||
class(vt.tr)
|
||||
# access one of the tree
|
||||
tree1 <- vt.tr$tree1
|
||||
# return infos
|
||||
# vt.tr$tree1$getInfos()
|
||||
# vt.tr$tree1$getRules()
|
||||
# use vt.subgroups tool:
|
||||
subgroups <- vt.subgroups(vt.tr)
|
||||
|
||||
}
|
||||
|
||||
|
|
5
revdep/check.R
Normal file
5
revdep/check.R
Normal file
|
@ -0,0 +1,5 @@
|
|||
library("devtools")
|
||||
|
||||
revdep_check()
|
||||
revdep_check_save_summary()
|
||||
revdep_check_print_problems()
|
BIN
revdep/checks.rds
Normal file
BIN
revdep/checks.rds
Normal file
Binary file not shown.
Loading…
Reference in a new issue