loglm | R Documentation |
Estimation of log-linear model; the estimation is done by lm
, but
the correct log-likelihood related quantities are returned
loglm(formula, data)
formula , data |
see |
An object of class "micsr"
, see micsr::micsr
for further details.
Yves Croissant
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.