loglm: Log-linear model

View source: R/loglm.R

loglmR Documentation

Log-linear model

Description

Estimation of log-linear model; the estimation is done by lm, but the correct log-likelihood related quantities are returned

Usage

loglm(formula, data)

Arguments

formula, data

see lm

Value

An object of class "micsr", see micsr::micsr for further details.

Author(s)

Yves Croissant

Examples

lm_model <- lm(log(dist) ~ log(speed), cars)
log_model <- loglm(dist ~ log(speed), cars)
coef(lm_model)
coef(log_model)
# same coefficients, supplementary sigma coefficient for `loglm`
logLik(lm_model)
logLik(log_model)
# log_model returns the correct value for the log-likelihood

micsr documentation built on May 29, 2024, 7:32 a.m.