boxplot_post_dist {StanMoMo}R Documentation

Boxplot for the posterior distribution

Description

The function generates boxplots for the posterior distribution of the main parameters

Usage

boxplot_post_dist(stan_fit, parm_name, ages, years)

Arguments

stan_fit

stan fit object

parm_name

string to indicate the name of the parameter, to choose from c('a', 'b', 'g', 'k', 'k2', 'phi')

ages

range of ages

years

range of years

Value

Posterior distribution shown as boxplots

Examples



years <- 1990:2017
ages <- 50:90
cohorts <- sort(unique(as.vector(sapply(years, function(year) year - ages))))
death <- FRMaleData$Dxt[formatC(ages),formatC(years)]
exposure <- FRMaleData$Ext[formatC(ages),formatC(years)]
iterations<-50 # Toy example, consider at least 2000 iterations
stan_fit <- fit_mo_mo("m6", death , exposure, ages, 0, 5, "nb", 1, 4,
log_marg = FALSE,iter=iterations)
boxplot_post_dist(stan_fit, "k", ages, years)
boxplot_post_dist(stan_fit, "g", ages, years)



[Package StanMoMo version 1.2.0 Index]