knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
This vignette aims to present how to use the training rando package.
During the design of the clinical trial, the prognostic factors are listed and the number of treatment arms is defined.
Let's imagine a study with 3 prognostic factors. For instance:
library(trainingrando) myprogfact <- CreatePrgFact(progfactLabel = "Age Group",progfactLevels=c("0-18 years", "19-35 years","36-60 years","> 60 years")) myprogfact <- AddNewPrgFact(currentProgfact=myprogfact,progfactLabel = "Type of Tumor",progfactLevels=c("A", "B","C")) myprogfact <- AddNewPrgFact(currentProgfact=myprogfact,progfactLabel = "Genotype.",progfactLevels=c("Genotype A", "Genotype B","Genotype C"))
Let's say that the study has four treatment arms (1:1:1:1):
myArms <- ArmLevelProg(data.frame("Name" = c('Placebo', 'Treatement1','Treatement2','Treatement3')))
Let's say that a first patient has been recruited and is entring in the study. A treatment is then randomly assigned to this first patient.
myRandoDataFrame <- AddFirstSubject(progfact=myprogfact,Arms=myArms)
Then a second patient enters in the study. This patient has also a his prognotics factors.
# Generate another patient myRandoDataFrame <- AddNextSubject(RandoDataFrame=myRandoDataFrame, progfact=myprogfact)
The simplest approach is to use a randomization procedure whereby each patient has an equal probability 1/N of receiving any one of the N treatments.
myRandoDataFrame02 <- PurlyRandom(Arms=myArms,RandoDataFrame=myRandoDataFrame,usubjid="Pat-0002")
myRandoDataFrame <- GenStudyTrial(npat = 25, progfact = myprogfact, Arms=myArms)
The function AddAResponse
create a response which is a constant:
$Y = \mu_0$
myResponse <- AddAResponse(RandoDataFrame=myRandoDataFrame,ResponseUnit='Weight (in kg)',RespValues=70)
The function RespAddFixedEffect
adds a fixed effect.
myResponse <- RespAddFixedEffect(Response=myResponse,RandoDataFrame=myRandoDataFrame,ColID=2, BetaVector=c(-1,0,0,1))
The function RespResidVar adds a residual variability which follows a normal distribution.
$Y2 = Y1 + \epsilon$
where
myResponse <- RespResidVar(Response=myResponse,SDReplicates=10)
myVarCovMatr <- UniformCorrelation(rho=0.5,sigma2=2,nTimePoints=6) myepsilon <- espsilonVarCov(VarCovMatr=myVarCovMatr, nTimePoints=6, RandoDataFrame=myRandoDataFrame)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.