Description Usage Arguments Value References See Also Examples
View source: R/AnalysisStack.R
This function generates analysis results according to the specified data and analysis models.
1 | AnalysisStack(data.model, analysis.model, sim.parameters)
|
data.model |
defines a |
analysis.model |
defines a |
sim.parameters |
defines a |
This function generates an analysis stack according to the data and analysis models and the simulation parameters objetcs. The object returned by the function is a AnalysisStack object containing:
description |
a description of the object. |
analysis.set |
a list of size
|
analysis.scenario.grid |
a
data frame indicating all data and analysis scenarios according to the
|
analysis.structure |
a list containing the analysis structure according
to the |
sim.parameters |
a list
containing the simulation parameters according to |
A specific analysis.set
of a AnalysisStack
object can be
extracted using the ExtractAnalysisStack
function.
http://gpaux.github.io/Mediana/
See Also DataModel
, AnalysisModel
and
SimParameters
and ExtractAnalysisStack
.
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 | ## Not run:
# Generation of an AnalysisStack object
##################################
# 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
case.study1.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))
# Analysis model
case.study1.analysis.model = AnalysisModel() +
Test(id = "Placebo vs treatment",
samples = samples("Placebo", "Treatment"),
method = "TTest") +
Statistic(id = "Mean Treatment",
method = "MeanStat",
samples = samples("Treatment"))
# Simulation Parameters
case.study1.sim.parameters = SimParameters(n.sims = 1000,
proc.load = 2,
seed = 42938001)
# Generate results
case.study1.analysis.stack = AnalysisStack(data.model = case.study1.data.model,
analysis.model = case.study1.analysis.model,
sim.parameters = case.study1.sim.parameters)
# Print the analysis results generated in the 100th simulation run
# for the 2nd data scenario for both samples
case.study1.analysis.stack$analysis.set[[100]][[2]]
# Extract the same set of data
case.study1.extracted.analysis.stack =
ExtractAnalysisStack(analysis.stack = case.study1.analysis.stack,
data.scenario = 2,
simulation.run = 100)
# A carefull attention should be paid on the index of the result.
# As only one data.scenario has been requested
# the result for data.scenario = 2 is now in the first position ($analysis.set[[1]][[1]]).
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.