MakeDejaData {dejaVu} | R Documentation |
Create a DejaData
object
Description
This object is can be used to create a SingleSim
object with
subject specific rates
Usage
MakeDejaData(data, arm, Id, rate = NULL)
Arguments
data |
A data frame containing the subject |
arm |
character the column name of the treatment arm for each subject |
Id |
character the column name of subject Id |
rate |
character the column name of the rate to be used when simulating (or NULL,
if using DejaData to import a data set, see |
Value
A DejaData
object
Examples
set.seed(232)
my.df <- data.frame(Id=1:100,
arm=c(rep(0,50),rep(1,50)),
covar=rbinom(n=100,size=1,prob=0.5))
my.df$rate <- 0.0025 + my.df$covar*0.002 + (1-my.df$arm)*0.002
my.dejaData <- MakeDejaData(my.df,arm="arm",rate="rate",Id="Id")
[Package dejaVu version 0.3.1 Index]