Description Usage Arguments Details References See Also Examples
This function creates an object of class OutcomeDist which can be
added to an object of class DataModel.
1 | OutcomeDist(outcome.dist, outcome.type = NULL)
|
outcome.dist |
defines the outcome distribution. |
outcome.type |
defines the outcome type. |
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 and sd.
BinomDist:
generate data following a binomial distribution. Required parameter:
prop.
BetaDist: generate data following a beta
distribution. Required parameter: a. and b.
ExpoDist: generate data following an exponential distribution.
Required parameter: rate.
WeibullDist: generate data
following a weibull distribution. Required parameter: shape and
scale.
TruncatedExpoDist: generate data following a
truncated exponential distribution. Required parameter: rate and
trunc.
PoissonDist: generate data following a Poisson
distribution. Required parameter: lambda.
NegBinomDist:
generate data following a negative binomial distribution. Required
parameters: dispersion and mean.
MultinomialDist:
generate data following a multinomial distribution. Required parameter:
prob.
MVNormalDist: generate data following a
multivariate normal distribution. Required parameters: par and
corr. For each generated endpoint, the par parameter must
contain the required parameters mean and sd. The corr
parameter specifies the correlation matrix for the endpoints.
MVBinomDist: generate data following a multivariate binomial
distribution. Required parameters: par and corr.For each
generated endpoint, the par parameter must contain the required
parameter prop. The corr parameter specifies the correlation
matrix for the endpoints.
MVExpoDist: generate data following a
multivariate exponential distribution. Required parameters: par and
corr. For each generated endpoint, the par parameter must
contain the required parameter rate. The corr 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
and corr. For each generated endpoint, the par parameter must
contain the required parameter rate. The corr parameter
specifies the correlation matrix for the endpoints.
MVMixedDist: generate data following a multivariate mixed
distribution. Required parameters: type, par and corr.
The type 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. The corr 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.
http://gpaux.github.io/Mediana/
See Also DataModel.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | # 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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.