1
0
Fork 0
mirror of https://github.com/prise6/aVirtualTwins.git synced 2024-04-27 19:12:45 +02:00
aVirtualTwins/man/formatRCTDataset.Rd

49 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

2016-10-09 02:43:51 +02:00
% Generated by roxygen2: do not edit by hand
2015-06-10 14:38:08 +02:00
% Please edit documentation in R/formatRCTDataset.R
\name{formatRCTDataset}
\alias{formatRCTDataset}
\title{RCT format for Virtual Twins}
\usage{
formatRCTDataset(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
2016-10-09 02:43:51 +02:00
interactions, set to TRUE (default value)}
2015-06-10 14:38:08 +02:00
}
\value{
return data.frame with good format (explained in details section) to run VirtualTwins
}
\description{
2016-10-09 02:43:51 +02:00
\code{formatRCTDataset} returns dataset that Virtual Twins is able to
2015-06-10 14:38:08 +02:00
analyze.
}
\details{
2016-10-09 02:43:51 +02:00
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
2015-06-10 14:38:08 +02:00
first column of \code{dataset}.
2016-10-09 02:43:51 +02:00
Treatment must have two distinct numeric values, 0 : no treatment, 1 :
2015-06-10 14:38:08 +02:00
treatment. Treatment is moved to the second column.
2016-10-09 02:43:51 +02:00
Qualitatives variables must be factor. If it has more than two levels, if
2015-06-10 14:38:08 +02:00
running VirtualTwins with interaction, it creates dummy variables.
}
\examples{
\dontrun{
data.format <- formatRCTDataset(data, "outcome", "treatment", TRUE)
}
data(sepsis)
data.format <- formatRCTDataset(sepsis, "survival", "THERAPY", T)
2016-10-09 02:43:51 +02:00
2015-06-10 14:38:08 +02:00
}