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

View source: R/fam.link.mer.r

fam.link.merR Documentation

Extract Distribution Family and Link Function

Description

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

Usage

fam.link.mer(mod)

Arguments

mod

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

Details

This utility function extracts the information from an mer or merMod object resulting from glmer or lmer. The function is called by modavg, modavgEffect, modavgPred, and predictSE.

Value

fam.link.mer returns a list with the following components:

family

the family of the distribution of the model.

link

the link function of the model.

supp.link

a character value indicating whether the link function used is supported by predictSE and modavgPred.

Author(s)

Marc J. Mazerolle

See Also

modavg, modavgPred, predictSE, glmer, lmer

Examples

##modified example from ?glmer
## Not run: 
if(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)
}

## End(Not run)


##example with linear mixed model with Orthodont data from
##Pinheiro and Bates (2000)
## Not run: 
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)

## End(Not run)

AICcmodavg documentation built on Nov. 17, 2023, 1:08 a.m.