Description Usage Arguments Details Value Examples
View source: R/formatRCTDataset.R
formatRCTDataset
returns dataset that Virtual Twins is able to
analyze.
1 | formatRCTDataset(dataset, outcome.field, treatment.field, interactions = TRUE)
|
dataset |
data.frame representing RCT's |
outcome.field |
name of the outcome's field in |
treatment.field |
name of the treatment's field in |
interactions |
logical. If running VirtualTwins with treatment's interactions, set to TRUE (default value) |
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 dataset
.
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 running VirtualTwins with interaction, it creates dummy variables.
return data.frame with good format (explained in details section) to run VirtualTwins
1 2 3 4 5 6 7 8 9 10 | ## Not run:
data.format <- formatRCTDataset(data, "outcome", "treatment", TRUE)
## End(Not run)
data(sepsis)
data.format <- formatRCTDataset(sepsis, "survival", "THERAPY", T)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.