# glm: Loglikelihood adjustments for glm fits In chantrics: Loglikelihood Adjustments for Econometric Models

## Description

In a generalised linear model (glm), the user can choose between a range of distributions of a response y, and can allow for non-linear relations between the mean outcome for a particular combination of covariates x, E(y_i\mid x_i)=μ_i, and the linear predictor, η_i=x_i^Tβ, which is the link function g(μ_i)=η_i. it is required to be monotonic. (For a quick introduction, see Kleiber and Zeileis (2008, Ch. 5.1), for more complete coverage of the topic, see, for example, Davison (2003, Ch. 10.3))

## Details

For more usage examples and more information on `glm` models, see the Introducing `chantrics` vignette by running `vignette("chantrics-vignette", package = "chantrics")`

## Supported families (within each family, any link function should work)

• `gaussian`

• `poisson`

• `binomial`

• `MASS::negative.binomial`

Also works for `MASS::glm.nb()`, note that the standard errors of the theta are not adjusted.

## References

Davison, A. C. 2003. Statistical Models. Cambridge Series on Statistical and Probabilistic Mathematics 11. Cambridge University Press, Cambridge.

Kleiber, Christian, and Achim Zeileis. 2008. Applied Econometrics with R. Edited by Robert Gentleman, Kurt Hornik, and Giovanni Parmigiani. Use r! New York: Springer-Verlag.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19``` ```# binomial example from Applied Econometrics in R, Kleiber/Zeileis (2008) # == probit == data("SwissLabor", package = "AER") swiss_probit <- glm(participation ~ . + I(age^2), data = SwissLabor, family = binomial(link = "probit") ) summary(swiss_probit) swiss_probit_adj <- adj_loglik(swiss_probit) summary(swiss_probit_adj) # == logit == swiss_logit <- glm(participation ~ . + I(age^2), data = SwissLabor, family = binomial(link = "logit") ) summary(swiss_logit) swiss_logit_adj <- adj_loglik(swiss_logit) summary(swiss_logit_adj) ```

chantrics documentation built on Sept. 29, 2021, 9:08 a.m.