ZinbHB | R Documentation |
This function is implemented to variable of interest (y) that assumed to be a Zero Inflated Negative Binomial Distribution. The range of data is (y >= 0). This model can be used to handle overdispersion and excess zero in data.
ZinbHB( formula, iter.update = 3, iter.mcmc = 1100, coef.nonzero, coef.zero, var.coef.nonzero, var.coef.zero, thin = 1, burn.in = 600, tau.u = 1, tau.v = 1, data )
formula |
Formula that describe the fitted model |
iter.update |
Number of updates with default |
iter.mcmc |
Number of total iterations per chain with default |
coef.nonzero |
Optional vector containing initial values |
coef.zero |
Optional vector containing initial values |
var.coef.nonzero |
Optional vector containing initial values |
var.coef.zero |
Optional vector containing initial values |
thin |
Thinning rate, must be a positive integer with default |
burn.in |
Number of iterations to discard at the beginning with default |
tau.u |
Variance of random effect area for non-zero count of variable interest with default |
tau.v |
Variance of random effect area for zero count of variable interest with default |
data |
The data frame |
This function returns a list of the following objects:
Est |
A dataframe that contains the values, standar deviation, and quantile of Small Area mean Estimates using Hierarchical bayesian method |
refVar |
Estimated random effect variances |
coefficient |
A data frame with the estimated model coefficient consist of |
plot.beta |
Trace, Density, Autocorrelation Function Plot of MCMC samples |
plot.gamma |
Trace, Density, Autocorrelation Function Plot of MCMC samples |
## Compute Fitted Model ## y ~ x1 +x2, nvar = 3 ## For data without any nonsampled area ## Load Dataset data(dataZINB) result <- ZinbHB(formula = y ~ x1 + x2, data = dataZINB) ## Result result$Est # Small Area mean Estimates result$refVar # refVar result$coefficient # coefficient # Load library 'coda' to execute the plot # autocorr.plot(result$plot.beta[[3]]) # Generate ACF Plot beta # plot(result$plot.beta[[3]]) # Generate Dencity and Trace plot beta # autocorr.plot(result$plot.gamma[[3]]) # Generate ACF Plot gamma # plot(result$plot.gamma[[3]]) # Generate Dencity and trace plot gamma ## For data with nonsampled area use dataZINBNS
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.