Nirosha Rathnayake
This R package is built to apply h-likelihood approach with bias
correction to make inferences in Small Area Estimation. The model
parameters are obtained through an iterative approximation based on
Newton Raphson method. The bias correction approach enhances the
accuracy of maximum hierarchical likelihood estimates (MHLEs). This R
package can be used to obtain improved MHLEs for fixed effects
,
random effects
, and dispersion parameters
for exponential family
distributions with random effect u
being normally distributed.
You can install the released version of hglmbc from CRAN with:
install.packages("hglmbc")
or, you can install the development version of hglmbc using devtools with:
# devtools::install_github("niroshar/hglmbc", force = TRUE)
This is a basic example which shows you how to solve a common problem:
library(hglmbc)
## basic example code
data <- eversmoke
mformula <- "smoke_ever ~ as.factor(age) + as.factor(gender) + as.factor(race)
+ as.factor(year) + povt_rate"
dom <- "county"
y.family <- "binomial"
rand.family <- "gaussian"
## Fit the model
# hglmbc.fit <- hglmbc(data=eversmoke, mformula, dom = "county", y.family=binomial)
# model_fit <- hglmbc(data=df,X=NULL,y=NULL,m=NULL,re=NULL,y.dist="Binomial",u.dist="Normal",tol=1e-10)
# summary(model_fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.