This function fits generalized linear models by maximizing the joint log-likeliood, which is set in a separate function. Only single-parameter members of the exponential family are covered. The post-estimation output is designed to work with existing reporting functions.
ml_glm(formula, data, family, link, offset = 0, start = NULL, verbose =
FALSE, ...)
an object of class '"formula"' (or one that can be coerced to that class): a symbolic description of the model to be fitted. (See the help for 'glm' for more details).
a data frame containing the variables in the model.
a description of the error distribution be used in the model. This must be a character string naming a family.
a description of the link function be used in the model. This must be a character string naming a link function.
this can be used to specify an _a priori_ known component to be included in the linear predictor during fitting. This should be 0 or a numeric vector of length equal to the number of cases.
optional starting points for the parameter estimation.
logical flag affecting the detail of printing. Defaults to FALSE.
optional arguments to pass within the function.
the output of optim.
the design matrix.
the response variable.
the call used for the function.
the number of observations.
the degrees of freedom for the null model.
the residual degrees of freedom.
the residual deviance.
the residual deviance for the null model.
the deviance residuals.
parameter estimates.
standard errors of parameter estimates.
Akaike's Information Criterion.
the number of iterations required for convergence.
The containing package, msme, provides the needed functions to use the ml_glm function to fit the Poisson and Bernoulli families, and supports the use of the identity, log, logit, probit, and complementary log-log link functions. The object returned by the function is designed to be reported by the print.glm function.
Hilbe, J.M., and Robinson, A.P. 2013. Methods of Statistical Model Estimation. Chapman & Hall / CRC.
# NOT RUN {
data(medpar)
ml.poi <- ml_glm(los ~ hmo + white,
family = "poisson",
link = "log",
data = medpar)
ml.poi
summary(ml.poi)
# }
Run the code above in your browser using DataLab