OutcomeDist {Mediana} | R Documentation |
OutcomeDist object
Description
This function creates an object of class OutcomeDist
which can be added to an object of class DataModel
.
Usage
OutcomeDist(outcome.dist, outcome.type = NULL)
Arguments
outcome.dist |
defines the outcome distribution. |
outcome.type |
defines the outcome type. |
Details
Objects of class OutcomeDist
are used in objects of class DataModel
to specify the outcome distribution of the generated data. A single object of class OutcomeDist
can be added to an object of class DataModel
.
Several distribution are already implemented in the Mediana package (listed below, along with the required parameters to specify in the outcome.par
argument of the Sample
object) to be used in the outcome.dist
argument:
-
UniformDist
: generate data following a univariate distribution. Required parameter:max
. -
NormalDist
: generate data following a normal distribution. Required parameters:mean
andsd
. -
BinomDist
: generate data following a binomial distribution. Required parameter:prop
. -
BetaDist
: generate data following a beta distribution. Required parameter:a
. andb
. -
ExpoDist
: generate data following an exponential distribution. Required parameter:rate
. -
WeibullDist
: generate data following a weibull distribution. Required parameter:shape
andscale
. -
TruncatedExpoDist
: generate data following a truncated exponential distribution. Required parameter:rate
andtrunc
. -
PoissonDist
: generate data following a Poisson distribution. Required parameter:lambda
. -
NegBinomDist
: generate data following a negative binomial distribution. Required parameters:dispersion
andmean
. -
MultinomialDist
: generate data following a multinomial distribution. Required parameter:prob
. -
MVNormalDist
: generate data following a multivariate normal distribution. Required parameters:par
andcorr
. For each generated endpoint, thepar
parameter must contain the required parametersmean
andsd
. Thecorr
parameter specifies the correlation matrix for the endpoints. -
MVBinomDist
: generate data following a multivariate binomial distribution. Required parameters:par
andcorr
.For each generated endpoint, thepar
parameter must contain the required parameterprop
. Thecorr
parameter specifies the correlation matrix for the endpoints. -
MVExpoDist
: generate data following a multivariate exponential distribution. Required parameters:par
andcorr
. For each generated endpoint, thepar
parameter must contain the required parameterrate
. Thecorr
parameter specifies the correlation matrix for the endpoints. -
MVExpoPFSOSDist
: generate data following a multivariate exponential distribution to generate PFS and OS endpoints. The PFS value is imputed to the OS value if the latter occurs earlier. Required parameters:par
andcorr
. For each generated endpoint, thepar
parameter must contain the required parameterrate
. Thecorr
parameter specifies the correlation matrix for the endpoints. -
MVMixedDist
: generate data following a multivariate mixed distribution. Required parameters:type
,par
andcorr
. Thetype
parameter can take the following values:-
NormalDist
-
BinomDist
-
ExpoDist
For each generated endpoint, the
par
parameter must contain the required parameters according to the type of distribution. Thecorr
parameter specifies the correlation matrix for the endpoints. -
The outcome.type
argument defines the outcome's type. This argument accepts only two values:
-
standard
: for fixed design setting. -
event
: for event-driven design setting.
The outcome's type must be defined for each endpoint in case of multivariate disribution, e.g. c("event","event")
in case of multivariate exponential distribution.
References
http://gpaux.github.io/Mediana/
See Also
See Also DataModel
.
Examples
# Simple example with a univariate distribution
# Outcome parameter set 1
outcome1.placebo = parameters(mean = 0, sd = 70)
outcome1.treatment = parameters(mean = 40, sd = 70)
# Outcome parameter set 2
outcome2.placebo = parameters(mean = 0, sd = 70)
outcome2.treatment = parameters(mean = 50, sd = 70)
# Data model
data.model = DataModel() +
OutcomeDist(outcome.dist = "NormalDist") +
SampleSize(c(50, 55, 60, 65, 70)) +
Sample(id = "Placebo",
outcome.par = parameters(outcome1.placebo, outcome2.placebo)) +
Sample(id = "Treatment",
outcome.par = parameters(outcome1.treatment, outcome2.treatment))
# Complex example with multivariate distribution following a Binomial and a Normal distribution
# Variable types
var.type = list("BinomDist", "NormalDist")
# Outcome distribution parameters
plac.par = list(list(prop = 0.3), list(mean = -0.10, sd = 0.5))
dosel.par1 = list(list(prop = 0.40), list(mean = -0.20, sd = 0.5))
dosel.par2 = list(list(prop = 0.45), list(mean = -0.25, sd = 0.5))
dosel.par3 = list(list(prop = 0.50), list(mean = -0.30, sd = 0.5))
doseh.par1 = list(list(prop = 0.50), list(mean = -0.30, sd = 0.5))
doseh.par2 = list(list(prop = 0.55), list(mean = -0.35, sd = 0.5))
doseh.par3 = list(list(prop = 0.60), list(mean = -0.40, sd = 0.5))
# Correlation between two endpoints
corr.matrix = matrix(c(1.0, 0.5,
0.5, 1.0), 2, 2)
# Outcome parameter set 1
outcome1.plac = list(type = var.type, par = plac.par, corr = corr.matrix)
outcome1.dosel = list(type = var.type, par = dosel.par1, corr = corr.matrix)
outcome1.doseh = list(type = var.type, par = doseh.par1, corr = corr.matrix)
# Outcome parameter set 2
outcome2.plac = list(type = var.type, par = plac.par, corr = corr.matrix)
outcome2.dosel = list(type = var.type, par = dosel.par2, corr = corr.matrix)
outcome2.doseh = list(type = var.type, par = doseh.par2, corr = corr.matrix)
# Outcome parameter set 3
outcome3.plac = list(type = var.type, par = plac.par, corr = corr.matrix)
outcome3.doseh = list(type = var.type, par = doseh.par3, corr = corr.matrix)
outcome3.dosel = list(type = var.type, par = dosel.par3, corr = corr.matrix)
# Data model
data.model = DataModel() +
OutcomeDist(outcome.dist = "MVMixedDist") +
SampleSize(c(100, 120)) +
Sample(id = list("Plac ACR20", "Plac HAQ-DI"),
outcome.par = parameters(outcome1.plac, outcome2.plac, outcome3.plac)) +
Sample(id = list("DoseL ACR20", "DoseL HAQ-DI"),
outcome.par = parameters(outcome1.dosel, outcome2.dosel, outcome3.dosel)) +
Sample(id = list("DoseH ACR20", "DoseH HAQ-DI"),
outcome.par = parameters(outcome1.doseh, outcome2.doseh, outcome3.doseh))