ExtractDataStack {Mediana} | R Documentation |
ExtractDataStack function
Description
This function extracts data stack according to the data scenario, sample id and simulation run specified.
Usage
ExtractDataStack(data.stack,
data.scenario = NULL,
sample.id = NULL,
simulation.run = NULL)
Arguments
data.stack |
defines a |
data.scenario |
defines the data scenario index to extract. By default all data scenarios will be extracted. |
sample.id |
defines the sample id to extract. By default all sample ids will be extracted. |
simulation.run |
defines the simulation run index. By default all simulation runs will be extracted. |
Value
This function extract a particular set of data stack according to the data scenario, sample id and simulation runs index. The object returned by the function is a list having the same structure as the data.set
argument of a DataStack
object:
data.set |
a list of size corresponding to the number of simulation runs specified by the user defined in the |
References
http://gpaux.github.io/Mediana/
See Also
See Also DataStack
.
Examples
## Not run:
# Generation of a DataStack 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))
# Simulation Parameters
case.study1.sim.parameters = SimParameters(n.sims = 1000,
proc.load = 2,
seed = 42938001)
# Generate data
case.study1.data.stack = DataStack(data.model = case.study1.data.model,
sim.parameters = case.study1.sim.parameters)
# Print the data set generated in the 100th simulation run
# for the 2nd data scenario for both samples
case.study1.data.stack$data.set[[100]]$data.scenario[[2]]$sample
# Extract the same set of data
case.study1.extracted.data.stack = ExtractDataStack(data.stack = case.study1.data.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 (data.scenario[[1]]).
## End(Not run)