Learn R Programming

AICcmodavg (version 1.0)

fam.link.mer: Extract Distribution Family and Link Function

Description

This function extracts the distribution family and link function a generalized linear mixed model fit with 'glmer' or 'lmer'.

Usage

fam.link.mer(mod)

Arguments

mod
an object of 'mer' class resulting from the fit of 'glmer' or 'lmer'.

Value

  • 'fam.link.mer' returns a list with the following components:
  • familythe family of the distribution of the model.
  • linkthe link function of the model.
  • supp.linka character value indicating whether the link function used is supported by 'predictSE.mer' and 'modavgpred.mer'.

Details

This is an extractor function that extracts the information from the call of 'glmer' or 'lmer' and it is called by 'modavg.mer', 'modavgpred.mer', and 'predictSE.mer'.

See Also

modavg, modavgpred, predictSE.mer, glmer, lmer

Examples

Run this code
##modified example from glmer
require(lme4)
##create proportion of incidence
cbpp$prop <- cbpp$incidence/cbpp$size
gm1 <- glmer(prop ~ period + (1 | herd), family = binomial, weights =
size, data = cbpp)
fam.link.mer(gm1)
gm2 <- glmer(prop ~ period + (1 | herd), family = binomial(link =
"cloglog"), weights = size, data = cbpp)
fam.link.mer(gm2)

##example with linear mixed model with Orthodont data from
##Pinheiro and Bates (2000)
data(Orthodont, package = "nlme")
m1 <- lmer(distance ~ Sex + (1 | Subject), data = Orthodont, REML =
FALSE)
fam.link.mer(m1)
m2 <- glmer(distance ~ Sex + (1 | Subject), family = gaussian(link =
"log"), data = Orthodont, REML = FALSE)
fam.link.mer(m2)

detach(package:lme4)

Run the code above in your browser using DataLab