library(hglmbc2)

The proposed `calibrated h-likelihood with bias correction’ approach is currently limited to GLM family distributions where a response variable whose conditional distribution of \(y|u\) belongs to exponential family and the random effect \(u\sim N(0,\sigma^2)\). The algorithm consists of two main key components:

  1. A linear predictor: \(\eta_i=\sum_{i=1}^n x_i\beta_i\),
  2. A link function: \(\eta_i = g(\mu_i)\),

The list of components in each GLM family distribution in R is illustrated in an object of class, family(run ?family in R console for more details). As an example, the code below shows the constituent parts for the binomial GLM, which is what is used to fit linear logistic regression:

b.family <- binomial()
class(b.family)
#> [1] "family"
names(b.family)
#>  [1] "family"     "link"       "linkfun"    "linkinv"    "variance"  
#>  [6] "dev.resids" "aic"        "mu.eta"     "initialize" "validmu"   
#> [11] "valideta"   "simulate"

p.family <- poisson()

p.family
#> 
#> Family: poisson 
#> Link function: log
b.family
#> 
#> Family: binomial 
#> Link function: logit

Example: Binomial-Normal HGLM (Mixed Logit Model) with Bias Correction Binomial-Normal HGLM is also known as the mixed logit model in GLM family with the binary response variable and the random effect \(u\sim N(0,\sigma^2)\).

library(hglmbc2)
## 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)
# hglmbc.fit$summary

  1. University of Nebraska Medical Center, , https://niroshar.github.io/My-Profile/