MakeDejaData: Create a 'DejaData' object

Description Usage Arguments Value Examples

View source: R/dejaData.R

Description

This object is can be used to create a SingleSim object with subject specific rates

Usage

1
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 ImportSim)

Value

A DejaData object

Examples

1
2
3
4
5
6
7
8
9
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")

dejaVu documentation built on April 27, 2021, 5:07 p.m.