GPois: Small Area Estimation Using Hierarchical Bayesian Method...

View source: R/gpois.R

GPoisR Documentation

Small Area Estimation Using Hierarchical Bayesian Method under Generalized Poisson Distribution

Description

This function is implemented to variable of interest (y) that assumed to be a Generalized Poisson Distribution. The range of data is 0 < y < ∞. Generalized Distribution model can be used to handle underdispersion and overdispersion in count data.

Usage

GPois(
  formula,
  iter.update = 3,
  iter.mcmc = 2000,
  coef,
  var.coef,
  thin = 1,
  burn.in = 1000,
  tau.u = 1,
  data
)

Arguments

formula

Formula that describe the fitted model

iter.update

Number of updates with default 3

iter.mcmc

Number of total iterations per chain with default 2000

coef

Regression coefficient for variable of interest (y)

var.coef

Variance of coefficient

thin

Thinning rate, must be a positive integer with default 1

burn.in

Number of iterations to discard at the beginning with default 1000

tau.u

Variance of random effect area for non-zero count of variable interest with default 1

data

The data frame

Value

This function returns a list of the following objects:

Est

A vector with the values of Small Area mean Estimates using Hierarchical Bayesian method

refVar

Estimated random effect variances

coefficient

A dataframe contains the estimated model coefficient

plot

Trace, Density, Autocorrelation Function Plot of MCMC samples

Examples

##For data without any non-sampled area
data(dataGPois)     # Load dataset

result <- GPois(y ~ x1 + x2, data = dataGPois)

result$Est           # Small Area mean estimates
result$refVar        # Estimated random effect variances
result$coefficient   # Estimated model coefficient

# Load library 'coda' to execute the plot
# autocorr.plot(result$plot[[3]])  # Generate ACF Plot
# plot(result$plot[[3]])           # Generate Density and Trace Plot

## For data with non-sampled area use dataGPoisNs


joiceevangelista/saeHB.gpois documentation built on June 15, 2022, 9:56 a.m.