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

or `lmer`

.

1 | ```
fam.link.mer(mod)
``` |

`mod` |
an object of |

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`

.

`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 |

Marc J. Mazerolle

`modavg`

, `modavgPred`

,
`predictSE`

, `glmer`

, `lmer`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ```
##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)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.