diff --git a/data-raw/sepsis.R b/data-raw/sepsis.R index 2207871..8426590 100644 --- a/data-raw/sepsis.R +++ b/data-raw/sepsis.R @@ -22,7 +22,9 @@ sum(is.na(sepsis.csv$survival)) # For futures computation i need to impute missing values # I use random forest imputation with randomForest package with simple parameters # I need to make survival field as factor -sepsis.csv$survival <- factor(sepsis.csv$survival, levels = 0:1) +sepsis.csv$survival <- factor(sepsis.csv$survival, levels = 0:1) +# reproducibility: +set.seed(123) sepsis.imp <- with(sepsis.csv, rfImpute(y = survival, x = sepsis.csv[, -1], iter = 5, ntree = 500)) str(sepsis.imp) diff --git a/data/sepsis.rdata b/data/sepsis.rdata index bd883b8..55b91ea 100644 Binary files a/data/sepsis.rdata and b/data/sepsis.rdata differ diff --git a/man/VT.difft.Rd b/man/VT.difft.Rd index 4b36f71..f178fde 100644 --- a/man/VT.difft.Rd +++ b/man/VT.difft.Rd @@ -10,8 +10,14 @@ 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 -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} +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 : +\deqn{P(Y = 1 | T = 1) - P(Y = 1 | T =0)} +So \emph{relative} method is : +\deqn{P(Y = 1 | T = 1)/P(Y = 1 | T =0)} +So \emph{absolute} method is : +\deqn{logit(P(Y = 1 | T = 1)) - logit(P(Y = 1 | T =0))} } \section{Fields}{ @@ -22,6 +28,9 @@ favorable outcome is 1. Then, \deqn{difft_i = twin1_i - twin2_i IF T_i = \item{\code{twin2}}{vector of \eqn{E(Y|T = another treatment)}} +\item{\code{method}}{Method available to compute difft : c("absolute", "relative", +"logit"). Absolute is default value. See details.} + \item{\code{difft}}{vector of difference between twin1 and twin2} }} \section{Methods}{ @@ -30,6 +39,7 @@ favorable outcome is 1. Then, \deqn{difft_i = twin1_i - twin2_i IF T_i = \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}} +\code{\link{VT.forest}}, \code{\link{VT.forest.one}}, + \code{\link{VT.forest.double}} } diff --git a/man/VT.object.Rd b/man/VT.object.Rd index 3094fe6..1698021 100644 --- a/man/VT.object.Rd +++ b/man/VT.object.Rd @@ -40,7 +40,7 @@ treatments.} \item{\code{getFormula()}}{Return formula : Y~T+X1+...+Xp. Usefull for cforest function.} -\item{\code{getIncidences()}}{Return incidence table of data.} +\item{\code{getIncidences(rule = NULL)}}{Return incidence table of data if rule set to NULL. Otherwise return incidence for the rule.} \item{\code{getX(interactions = T, trt = NULL)}}{Return predictors (T,X,X*T,X*(1-T)). Or (T,X) if interactions is FALSE. If trt is not NULL, return predictors for T = trt} diff --git a/man/VT.tree.Rd b/man/VT.tree.Rd index 7fe0bb4..2aea263 100644 --- a/man/VT.tree.Rd +++ b/man/VT.tree.Rd @@ -70,7 +70,7 @@ screening field} \item{\code{getInfos()}}{Return infos about tree} \item{\code{getRules(only.leaf = F, only.fav = F, tables = T, verbose = T, - compete = F)}}{Retrun subgroups discovered by the tree. See details.} + compete = F)}}{Return subgroups discovered by the tree. See details.} \item{\code{run(...)}}{Compute tree with rpart parameters} }} diff --git a/man/sepsis.Rd b/man/sepsis.Rd index d9509e7..0e1b14c 100644 --- a/man/sepsis.Rd +++ b/man/sepsis.Rd @@ -4,22 +4,17 @@ \name{sepsis} \alias{sepsis} \title{Clinical Trial for Sepsis desease} -\format{454 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} -}} +\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} } @@ -27,21 +22,25 @@ data(sepsis) } \description{ -Simulated clinical trial with two groups treatment about sepsis desease. See details. +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 method}. -\code{Sepsis} contains simulated data on 454 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 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())} +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} +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. } diff --git a/man/vt.data.Rd b/man/vt.data.Rd new file mode 100644 index 0000000..43ddf47 --- /dev/null +++ b/man/vt.data.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/object.wrapper.R +\name{vt.data} +\alias{vt.data} +\title{Initialize virtual twins data} +\usage{ +vt.data(dataset, outcome.field, treatment.field, interactions = TRUE, ...) +} +\arguments{ +\item{dataset}{data.frame representing RCT's} + +\item{outcome.field}{name of the outcome's field in \code{dataset}} + +\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)} + +\item{...}{parameters of \code{\link{VT.object}}} +} +\value{ +\code{VT.object} +} +\description{ +\code{vt.data} is a wrapper of \code{\link{formatRCTDataset}} and +\code{\link{VT.object}}. +} +