update md files

This commit is contained in:
François Vieille 2016-10-09 02:43:51 +02:00
parent e5e2f1b442
commit 5942b328e7
15 changed files with 110 additions and 102 deletions

View File

@ -1,4 +1,4 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/difft.R
\docType{class}
\name{VT.difft}
@ -8,8 +8,8 @@
A reference class to represent difference between twin1 and twin2
}
\details{
Difft are calculated depending on the favorable outcome chosen. It is the
second level of the outcome. For example, if the outcome is 0 and 1, the
Difft are calculated depending on the favorable outcome chosen. It is the
second level of the outcome. For example, if the outcome is 0 and 1, the
favorable outcome is 1. Then, \deqn{difft_i = twin1_i - twin2_i if T_i = 1}
\deqn{ difft_i = twin2_i - twin1_i if T_i = 0}.
So \emph{absolute} method is :

View File

@ -1,4 +1,4 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/forest.double.R
\docType{class}
\name{VT.forest.double}
@ -11,7 +11,7 @@ A reference class to compute twins via double random forests
\code{VT.forest.double} extends \code{VT.forest}.
\eqn{E(Y|T = 1)} if \eqn{T_i = 1} is estimated by OOB predictions from
\code{model_trt1}.
\code{model_trt1}.
\eqn{E(Y|T = 0)} if \eqn{T_i = 0} is estimated by OOB predictions from
\code{model_trt0}.
This is what \code{computeTwin1()} does.

View File

@ -1,4 +1,4 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/forest.fold.R
\docType{class}
\name{VT.forest.fold}
@ -11,13 +11,13 @@ A reference class to compute twins via k random forest
\code{VT.forest.fold} extends \code{VT.forest}
Twins are estimated by k-fold cross validation. A forest is computed on k-1/k
of the data and then used to estimate twin1 and twin2 on 1/k of the left
of the data and then used to estimate twin1 and twin2 on 1/k of the left
data.
}
\section{Fields}{
\describe{
\item{\code{interactions}}{logical set TRUE if model has been computed with
\item{\code{interactions}}{logical set TRUE if model has been computed with
interactions}
\item{\code{fold}}{numeric, number of fold, i.e. number of forest (k)}
@ -34,7 +34,7 @@ interactions}
\item{\code{run()}}{Compute twin1 and twin2 estimation. Switch treatment if necessary.}
}}
\seealso{
\code{\link{VT.difft}}, \code{\link{VT.forest}},
\code{\link{VT.difft}}, \code{\link{VT.forest}},
\code{\link{VT.forest.one}}, \code{\link{VT.forest.double}}
}

View File

@ -1,4 +1,4 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/forest.one.R
\docType{class}
\name{VT.forest.one}
@ -10,8 +10,8 @@ A reference class to compute twins via one random forest
\details{
\code{VT.forest.one} extends \code{VT.forest}.
OOB predictions are used to estimate \eqn{E(Y|T = real treatment)}. Then,
treatement is switched, it means that 1 becomes 0 and 0 becomes 1. We use
OOB predictions are used to estimate \eqn{E(Y|T = real treatment)}. Then,
treatement is switched, it means that 1 becomes 0 and 0 becomes 1. We use
again \code{model} to estimate \eqn{E(Y|T = the other treatment)}. This is
what \code{computeTwin1()} and \code{computeTwin2()} functions do.
}

View File

@ -1,4 +1,4 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/object.R
\docType{class}
\name{VT.object}
@ -8,7 +8,7 @@
A Reference Class to deal with RCT dataset
}
\details{
Currently working with binary response only. Continous will come, one day.
Currently working with binary response only. Continous will come, one day.
Two-levels treatment only as well.
\code{data} field should be as described, however if virtual twins won't used
@ -24,14 +24,14 @@ two levels factor if type is binary. T must be numeric or integer.}
\item{\code{screening}}{Logical, set to \code{FALSE} Set to \code{TRUE} to use
\code{varimp} in trees computation.}
\item{\code{varimp}}{Character vector of important variables to use in trees
\item{\code{varimp}}{Character vector of important variables to use in trees
computation.}
\item{\code{delta}}{Numeric representing the difference of incidence between
\item{\code{delta}}{Numeric representing the difference of incidence between
treatments.}
\item{\code{type}}{Character : binary or continous. Only binary is currently
available.}
\item{\code{type}}{Character : binary or continous. Only binary is currently
available.}
}}
\section{Methods}{
@ -73,6 +73,7 @@ vt.o$getY(0)
# Print incidences
vt.o$getIncidences()
}
}
\seealso{
\code{\link{VT.difft}}

View File

@ -1,4 +1,4 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/predict.R
\docType{methods}
\name{VT.predict}
@ -35,7 +35,7 @@ class.}
predictions are returned.}
\item{type}{Must be binary or continous, depending on the outcome. Only
binary is really available.}
binary is really available.}
}
\value{
vector \eqn{E(Y=1)}
@ -45,16 +45,16 @@ VT.predict generic function
}
\section{Methods (by class)}{
\itemize{
\item \code{rfor = RandomForest,newdata = missing,type = character}:
\item \code{rfor = RandomForest,newdata = missing,type = character}: rfor(RandomForest) newdata (missing) type (character)
\item \code{rfor = RandomForest,newdata = data.frame,type = character}:
\item \code{rfor = RandomForest,newdata = data.frame,type = character}: rfor(RandomForest) newdata (data.frame) type (character)
\item \code{rfor = randomForest,newdata = missing,type = character}:
\item \code{rfor = randomForest,newdata = missing,type = character}: rfor(randomForest) newdata (missing) type (character)
\item \code{rfor = randomForest,newdata = data.frame,type = character}:
\item \code{rfor = randomForest,newdata = data.frame,type = character}: rfor(randomForest) newdata (data.frame) type (character)
\item \code{rfor = train,newdata = ANY,type = character}:
\item \code{rfor = train,newdata = ANY,type = character}: rfor(train) newdata (ANY) type (character)
\item \code{rfor = train,newdata = missing,type = character}:
\item \code{rfor = train,newdata = missing,type = character}: rfor(train) newdata (missing) type (character)
}}

View File

@ -1,4 +1,4 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tree.class.R
\docType{class}
\name{VT.tree.class}

View File

@ -1,4 +1,4 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tree.reg.R
\docType{class}
\name{VT.tree.reg}

View File

@ -1,4 +1,4 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/aVirtualTwins.R
\docType{package}
\name{aVirtualTwins}
@ -10,16 +10,16 @@ aVirtualTwins is written mainly with reference classes. Briefly, there is three
\itemize{
\item \code{\link{VT.object}} class to represent RCT dataset used by aVirtualTwins. To format correctly RCT dataset, use \code{\link{formatRCTDataset}}.
\item \code{\link{VT.difft}} class to compute difference between twins. Family \code{\link{VT.forest}} extends it to compute twins by random forest.
\code{\link{vt.forest()}} is users function.
\item \code{\link{VT.tree}} class to find subgroups from \code{difft} by CART trees. \code{\link{VT.tree.class}} and \code{\link{VT.tree.reg}} extend it.
\code{\link{vt.tree()}} is users function.
\code{\link{vt.forest}} is users function.
\item \code{\link{VT.tree}} class to find subgroups from \code{difft} by CART trees. \code{\link{VT.tree.class}} and \code{\link{VT.tree.reg}} extend it.
\code{\link{vt.tree}} is users function.
}
}
\section{TODO LIST}{
\emph{last update : 27.07.2015}
\itemize{
\item More detailed documentation and vignettes
\item More detailed documentation and vignettes
\item Write examples
\item ...
}

View File

@ -1,4 +1,4 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/formatRCTDataset.R
\name{formatRCTDataset}
\alias{formatRCTDataset}
@ -14,30 +14,33 @@ formatRCTDataset(dataset, outcome.field, treatment.field, interactions = TRUE)
\item{treatment.field}{name of the treatment's field in \code{dataset}}
\item{interactions}{logical. If running VirtualTwins with treatment's
interactions, set to TRUE (default value)}
interactions, set to TRUE (default value)}
}
\value{
return data.frame with good format (explained in details section) to run VirtualTwins
}
\description{
\code{formatRCTDataset} returns dataset that Virtual Twins is able to
\code{formatRCTDataset} returns dataset that Virtual Twins is able to
analyze.
}
\details{
This function check these differents topic: Outcome must be binary and a
factor. If numeric with two distincts values, outcome becomes a factor where
the favorable reponse is the second level. Also, outcome is moved on the
This function check these differents topic: Outcome must be binary and a
factor. If numeric with two distincts values, outcome becomes a factor where
the favorable reponse is the second level. Also, outcome is moved on the
first column of \code{dataset}.
Treatment must have two distinct numeric values, 0 : no treatment, 1 :
Treatment must have two distinct numeric values, 0 : no treatment, 1 :
treatment. Treatment is moved to the second column.
Qualitatives variables must be factor. If it has more than two levels, if
Qualitatives variables must be factor. If it has more than two levels, if
running VirtualTwins with interaction, it creates dummy variables.
}
\examples{
\dontrun{
data.format <- formatRCTDataset(data, "outcome", "treatment", TRUE)
}
}
}

View File

@ -1,45 +1,45 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{sepsis}
\alias{sepsis}
\title{Clinical Trial for Sepsis desease}
\format{470 patients and 13 variables. \describe{ \item{survival}{binary
outcome} \item{THERAPY}{1 for active treatment, 0 for control treatment}
\item{TIMFIRST}{Time from first sepsis-organ fail to start drug}
\item{AGE}{Patient age in years} \item{BLLPLAT}{Baseline local platelets}
\item{blSOFA}{Sum of baselin sofa (cardiovascular, hematology,
hepaticrenal, and respiration scores)} \item{BLLCREAT}{Base creatinine}
\item{ORGANNUM}{Number of baseline organ failures}
\item{PRAPACHE}{Pre-infusion apache-ii score} \item{BLGCS}{Base GLASGOW
coma scale score} \item{BLIL6}{Baseline serum IL-6 concentration}
\item{BLADL}{Baseline activity of daily living score}
\format{470 patients and 13 variables. \describe{ \item{survival}{binary
outcome} \item{THERAPY}{1 for active treatment, 0 for control treatment}
\item{TIMFIRST}{Time from first sepsis-organ fail to start drug}
\item{AGE}{Patient age in years} \item{BLLPLAT}{Baseline local platelets}
\item{blSOFA}{Sum of baselin sofa (cardiovascular, hematology,
hepaticrenal, and respiration scores)} \item{BLLCREAT}{Base creatinine}
\item{ORGANNUM}{Number of baseline organ failures}
\item{PRAPACHE}{Pre-infusion apache-ii score} \item{BLGCS}{Base GLASGOW
coma scale score} \item{BLIL6}{Baseline serum IL-6 concentration}
\item{BLADL}{Baseline activity of daily living score}
\item{BLLBILI}{Baseline local bilirubin} }}
\source{
\url{http://biopharmnet.com/wiki/Software_for_subgroup_identification_and_analysis}
\url{http://biopharmnet.com/subgroup-analysis-software/}
}
\usage{
data(sepsis)
}
\description{
Simulated clinical trial with two groups treatment about sepsis desease. See
Simulated clinical trial with two groups treatment about sepsis desease. See
details.
}
\details{
This dataset is taken from
\href{http://biopharmnet.com/wiki/Software_for_subgroup_identification_and_analysis}{SIDES
This dataset is taken from
\href{http://biopharmnet.com/subgroup-analysis-software/}{SIDES
method}.
\code{Sepsis} contains simulated data on 470 subjects with a binary outcome
\code{Sepsis} contains simulated data on 470 subjects with a binary outcome
survival, that stores survival status for patient after 28 days of treatment,
value of 1 for subjects who died after 28 days and 0 otherwise. There are 11
value of 1 for subjects who died after 28 days and 0 otherwise. There are 11
covariates, listed below, all of which are numerical variables.
Note that contrary to the original dataset used in SIDES, missing values have
been imputed by random forest \code{(randomForest::rfImpute())}. See file
been imputed by random forest \code{(randomForest::rfImpute())}. See file
data-raw/sepsis.R for more details.
True subgroup is \emph{PRAPACHE <= 26 & AGE <= 49.80}. \emph{NOTE:} This
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.
}

View File

@ -1,4 +1,4 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/object.wrapper.R
\name{vt.data}
\alias{vt.data}
@ -13,7 +13,7 @@ vt.data(dataset, outcome.field, treatment.field, interactions = TRUE, ...)
\item{treatment.field}{name of the treatment's field in \code{dataset}}
\item{interactions}{logical. If running VirtualTwins with treatment's
\item{interactions}{logical. If running VirtualTwins with treatment's
interactions, set to TRUE (default value)}
\item{...}{parameters of \code{\link{VT.object}}}
@ -22,7 +22,7 @@ interactions, set to TRUE (default value)}
\code{VT.object}
}
\description{
\code{vt.data} is a wrapper of \code{\link{formatRCTDataset}} and
\code{vt.data} is a wrapper of \code{\link{formatRCTDataset}} and
\code{\link{VT.object}}. Allows to format your data.frame in order to create
a VT.object object.
}
@ -31,5 +31,6 @@ a VT.object object.
data(sepsis)
formatRCTdataset(sepsis, "survival", "THERAPY", T)
}
}

View File

@ -1,4 +1,4 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/forest.wrapper.R
\name{vt.forest}
\alias{vt.forest}
@ -9,34 +9,34 @@ vt.forest(forest.type = "one", vt.data, interactions = T,
model_trt0 = NULL, ratio = 1, fold = 10, ...)
}
\arguments{
\item{forest.type}{must be a character. "one" to use VT.forest.one class.
\item{forest.type}{must be a character. "one" to use VT.forest.one class.
"double" to use VT.forest.double. "fold" to use VT.forest.fold.}
\item{vt.data}{\code{\link{VT.object}}. Can be return of \code{vt.data()}
\item{vt.data}{\code{\link{VT.object}}. Can be return of \code{vt.data()}
function}
\item{interactions}{logical. If running VirtualTwins with treatment's
\item{interactions}{logical. If running VirtualTwins with treatment's
interactions, set to TRUE (default value)}
\item{method}{character c("absolute", "relative", "logit"). See
\item{method}{character c("absolute", "relative", "logit"). See
\code{\link{VT.difft}}.}
\item{model}{allows to give a model you build outside this function. Can be
randomForest, train or cforest. Is only used with forest.type = "one". If
\item{model}{allows to give a model you build outside this function. Can be
randomForest, train or cforest. Is only used with forest.type = "one". If
NULL, a randomForest model is grown inside the function. NULL is default.}
\item{model_trt1}{see model_trt0 explanation and
\code{\link{VT.double.forest}} details.}
\item{model_trt1}{see model_trt0 explanation and
\code{\link{VT.forest.double}} details.}
\item{model_trt0}{works the same as model parameter. Is only used with
forest.type = "double". If NULL, a randomForest model is grown inside the
\item{model_trt0}{works the same as model parameter. Is only used with
forest.type = "double". If NULL, a randomForest model is grown inside the
function. NULL is default. See \code{\link{VT.forest.double}} for details.}
\item{ratio}{numeric value that allow sampsize to be a bit controlled.
Default to 1. See \code{\link{VT.forest.fold}}.}
\item{fold}{number of fold you want to construct forest with k-fold method.
Is only used with forest.type = "fold". Default to 5. See
\item{fold}{number of fold you want to construct forest with k-fold method.
Is only used with forest.type = "fold". Default to 5. See
\code{\link{VT.forest.fold}}}
\item{...}{randomForest() function parameters. Can be used for any forest.type.}
@ -45,18 +45,18 @@ Is only used with forest.type = "fold". Default to 5. See
\code{VT.difft}
}
\description{
\code{vt.forest} is a wrapper of \code{\link{VT.forest.one}},
\code{\link{VT.forest.double}} and \code{\link{VT.forest.fold}}. With
\code{vt.forest} is a wrapper of \code{\link{VT.forest.one}},
\code{\link{VT.forest.double}} and \code{\link{VT.forest.fold}}. With
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 :
# inside model :
vt.f <- vt.forest("one", vt.o)
# ...
# your model :
# ...
# your model :
rf <- randomForest(y = vt.o$getY(),
x = vt.o$getX(int = T),
mtry = 3,
@ -66,6 +66,7 @@ parameter forest.type, any of these class can be used with its own parameter.
# Can also use ... parameters
vt.f <- vt.forest("one", vt.o, mtry = 3, nodesize = 15)
# ...
}
}
}

View File

@ -1,34 +1,34 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tools.R
\name{vt.subgroups}
\alias{vt.subgroups}
\title{Visualize subgroups}
\usage{
vt.subgroups(vt.trees, only.leaf = T, only.fav = T, tables = F,
verbose = F)
verbose = F, compete = F)
}
\arguments{
\item{vt.trees}{\code{\link{VT.tree}} object. Or return of
\item{vt.trees}{\code{\link{VT.tree}} object. Or return of
\code{\link{vt.tree}} function. Can be a list.}
\item{only.leaf}{logical to select only leaf of trees. TRUE is default.}
\item{only.fav}{logical select only favorable subgroups (meaning with
\item{only.fav}{logical select only favorable subgroups (meaning with
favorable label of the tree). TRUE is default.}
\item{tables}{set to TRUE if tables of incidence must be shown. FALSE is
\item{tables}{set to TRUE if tables of incidence must be shown. FALSE is
default.}
\item{verbose}{print infos during computation. FALSE is default.}
\item{compete}{print competitors rules thanks to competitors computation of
the tree}
the tree}
}
\value{
data.frame of rules
}
\description{
Function which uses \code{\link{VT.tree}} intern functions. Package
Function which uses \code{\link{VT.tree}} intern functions. Package
rpart.plot must be loaded. See \code{\link{VT.tree}} for details.
}
\examples{
@ -42,7 +42,8 @@ rpart.plot must be loaded. See \code{\link{VT.tree}} for details.
# show subgroups
vt.subgroups(vt.tr)
# change options you'll be surprised !
vt.subgroups(vt.tr, verbose = T, tables = T)
}
vt.subgroups(vt.tr, verbose = T, tables = T)
}
}

View File

@ -1,4 +1,4 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tree.wrapper.R
\name{vt.tree}
\alias{vt.tree}
@ -8,16 +8,16 @@ vt.tree(tree.type = "class", vt.difft, sens = ">", threshold = seq(0.5,
0.8, 0.1), screening = NULL, ...)
}
\arguments{
\item{tree.type}{must be a character. "class" for classification tree, "reg"
\item{tree.type}{must be a character. "class" for classification tree, "reg"
for regression tree.}
\item{vt.difft}{\code{\link{VT.difft}} object. Or return of
\item{vt.difft}{\code{\link{VT.difft}} object. Or return of
\code{\link{vt.forest}} function.}
\item{sens}{must be a character c(">","<"). See \code{\link{VT.tree}} for
\item{sens}{must be a character c(">","<"). See \code{\link{VT.tree}} for
details.}
\item{threshold}{must be numeric. It can be a unique value or a vector. If
\item{threshold}{must be numeric. It can be a unique value or a vector. If
numeric vector, a list is returned. See \code{\link{VT.tree}} for details.}
\item{screening}{must be logical. If TRUE, only varimp variables of VT.object
@ -26,23 +26,23 @@ is used to create the tree.}
\item{...}{rpart() function parameters. Can be used for any tree.type.}
}
\value{
\code{VT.tree} or a list of \code{VT.tree} depending on threshold
\code{VT.tree} or a list of \code{VT.tree} depending on threshold
dimension. See examples.
}
\description{
\code{vt.tree} is a wrapper of \code{\link{VT.tree.class}} and
\code{\link{VT.tree.reg}}. With parameter tree.type, any of these two class
\code{vt.tree} is a wrapper of \code{\link{VT.tree.class}} and
\code{\link{VT.tree.reg}}. With parameter tree.type, any of these two class
can be used with its own parameter.
}
\details{
See \code{\link{VT.tree}}, \code{\link{VT.tree.class}} and
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 :
# 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))
@ -54,5 +54,6 @@ See \code{\link{VT.tree}}, \code{\link{VT.tree.class}} and
vt.tr$tree1$getInfos()
# ...
}
}