BAPC | R Documentation |
A Bayesian age-period-cohort model fitted using a Poisson model within INLA is used to project mortality or disease rates. Age, period and/or cohort effects are either modelled using a random walk of second order (RW2), or fixed effect (drift).
BAPC(APCList, predict = list(npredict = 0, retro = TRUE), model = list(age = list(model = "rw2", prior="loggamma", param = c(1, 0.00005), initial = 4, scale.model=FALSE), period = list(include = TRUE, model = "rw2", prior="loggamma", param = c(1, 0.00005), initial = 4, scale.model=FALSE), cohort = list(include = TRUE, model = "rw2", prior="loggamma", param = c(1, 0.00005), initial = 4, scale.model=FALSE), overdis = list(include = TRUE, model = "iid", prior="loggamma", param = c(1, 0.005), initial = 4)), secondDiff = FALSE, stdweight = NULL, verbose = FALSE)
APCList |
a |
predict |
a list specifying how many periods are to be projected and whether existing counts shoud be removed and projected.
The first argument |
model |
a list composed of four arguments: age, period, cohort, overdis. For each argument a separate list is to be specified defining whether the component should be included and if so, which model should be used. Possible arguments are:
|
secondDiff |
Boolean (default:FALSE) indicating whether summary estimates for the second differences of age, period and cohort effects should be computed. |
stdweight |
Numeric vector with length equal to the number of age groups used to derive age-standardized projections. If the weights do not sum to one, they will be normalised internally. If no weights are provided, there will no age-standardized projections be computed. |
verbose |
Boolean (default:FALSE) indicating whether the program should run in a verbose model. |
An APCList
object.
Andrea Riebler and Leonhard Held
Havard Rue, Sara Martino, and Nicholas Chopin (2009). Approximate Bayesian Inference for Latent Gaussian Models Using Integrated Nested Laplace Approximations. Journal of the Royal Statistical Society B, 71, 319-392. (www.r-inla.org)
Sigrunn Holbek Sorbye and Havard Rue (2014). "Scaling intrinsic Gaussian Markov random field priors in spatial modelling." Spatial Statistics 8: 39-51.
inla
## Not run: if(requireNamespace("INLA", quietly = TRUE)) { require(INLA) data(FemLCSweden) data(FemPYSweden) data(whostandard) lc_sweden <- APCList(FemLCSweden, FemPYSweden, gf=5) result <- BAPC(lc_sweden, predict=list(npredict=10, retro=TRUE), secondDiff=FALSE, stdweight=whostandard[6:17,2], verbose=FALSE) } ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.