| get.e0.prediction {bayesLife} | R Documentation |
Accessing a Prediction Object
Description
Function get.e0.prediction retrieves results of a prediction and creates an object of class bayesLife.prediction. Function has.e0.prediction checks an existence of such results. Analogously, functions get.e0.jmale.prediction and has.e0.jmale.prediction retrieve and check an existence of male predictions from a given female prediction object.
Usage
get.e0.prediction(mcmc = NULL, sim.dir = NULL, joint.male = FALSE, mcmc.dir = NULL)
has.e0.prediction(mcmc = NULL, sim.dir = NULL)
get.e0.jmale.prediction(e0.pred)
has.e0.jmale.prediction(e0.pred)
Arguments
mcmc |
Object of class |
sim.dir |
Directory where the prediction is stored. It should correspond to the value of the |
joint.male |
Logical. If |
mcmc.dir |
Optional argument to be used only in a special case when the mcmc object contained in the prediction object was estimated in different directory than in the one to which it points to (for example due to moving or renaming the original directory). The argument causes that the mcmc is redirected to the given directory. |
e0.pred |
Object of class |
Details
If mcmc is not NULL, the search directory is set to mcmc$meta$output.dir. This approach assumes that the prediction was stored in the same directory as the MCMC simulation, i.e. the output.dir argument of the e0.predict function was set to NULL. If it is not the case, the argument mcmc.dir should be used.
Function get.e0.jmale.prediction extracts male projections from the e0.pred objects (which should be a female prediction object), if the male prediction was generated using the e0.jmale.predict function. has.e0.jmale.prediction checks if such male prediction was generated.
Value
Functions has.e0.prediction and has.e0.jmale.prediction return a logical indicating if a prediction exists.
Functions get.e0.prediction and get.e0.jmale.prediction return an
object of class bayesLife.prediction.
Author(s)
Hana Sevcikova
See Also
bayesLife.prediction, e0.predict, summary.bayesLife.prediction, e0.jmale.predict
Examples
sim.dir <- file.path(find.package("bayesLife"), "ex-data", "bayesLife.output")
pred <- get.e0.prediction(sim.dir = sim.dir)
# female prediction summary
summary(pred, country = "Canada")
## Not run:
# male prediction summary
# (works only if a joint male prediction exists - not the case in this toy example)
summary(get.e0.jmale.prediction(pred), country = "Canada")
## End(Not run)