README.md

Nirosha Rathnayake

Travis build
status AppVeyor build
status

hglmbc

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.

Installation

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)

Example 1

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)


niroshar/HGLMBC documentation built on June 18, 2020, 10:26 p.m.