Learn R Programming

SUMMER (version 0.1.0)

fitINLA: Fit INLA models to direct estimators.

Description

Fit INLA models to direct estimators.

Usage

fitINLA(data, Amat, geo, formula = NULL, year_names, na.rm = TRUE,
  redo.prior = FALSE, priors = NULL, useHyper = FALSE, a.iid = NULL,
  b.iid = NULL, a.rw1 = NULL, b.rw1 = NULL, a.rw2 = NULL,
  b.rw2 = NULL, a.icar = NULL, b.icar = NULL)

Arguments

data

Combined dataset

Amat

Adjacency matrix for the regions

geo

Geo file

formula

INLA formula. Defaults to RW2, ICAR, IID time, IID, region, IID survey effect, IID time-region interaction, IID survey-region interaction, and IID survey-time-region interaction.

year_names

string vector of year names

na.rm

Logical indicator of whether to remove rows with NA values in the data. Default set to TRUE.

redo.prior

Logical indicator of whether to re-estimate hyper parameters

priors

priors from simhyper

useHyper

option to manually set all hyper priors

a.iid

hyper parameter for i.i.d random effects, only need if useHyper = TRUE

b.iid

hyper parameter for i.i.d random effects, only need if useHyper = TRUE

a.rw1

hyper parameter for RW1 random effects, only need if useHyper = TRUE

b.rw1

hyper parameter for RW1 random effects, only need if useHyper = TRUE

a.rw2

hyper parameter for RW2 random effects, only need if useHyper = TRUE

b.rw2

hyper parameter for RW2 random effects, only need if useHyper = TRUE

a.icar

hyper parameter for ICAR random effects, only need if useHyper = TRUE

b.icar

hyper parameter for ICAR random effects, only need if useHyper = TRUE

Value

INLA model fit using the provided formula, country summary data, and geographic data

See Also

countrySummary

Examples

Run this code
# NOT RUN {
data(Uganda)
data(UgandaMap)
geo <- UgandaMap$geo
mat <- UgandaMap$Amat
years <- c("85-89", "90-94", "95-99", "00-04", "05-09", "10-14")

# Get direct estimates
u5m <- countrySummary_mult(births = Uganda, years = years, idVar = "id", 
regionVar = "region", timeVar = "time", clusterVar = "~clustid+id", 
ageVar = "age", weightsVar = "weights", geo.recode = NULL)

# Get hyper priors
priors <- simhyper(R = 2, nsamp = 1e+05, nsamp.check = 5000, Amat = mat)

# Fit INLA models
data <- data[data$region %in% c("central","eastern","northern","western"),]
inla_model <- fitINLA(data = data, geo = geo, Amat = mat, year_names = years, priors = priors)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab