Description Usage Arguments Details Value Author(s) References See Also Examples
This function fits a wide range of generalized linear models using the iteratively reweighted least squares algorithm. The intended benefit of this function is for teaching. Its scope is similar to that of R's glm function, which should be preferred for operational use.
1 |
formula |
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). |
data |
a data frame containing the variables in the model. |
family |
a description of the error distribution be used in the model. This must be a character string naming a family. |
link |
a description of the link function be used in the model. This must be a character string naming a link function. |
tol |
an optional quantity to use as the convergence criterion for the change in deviance. |
offset |
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. |
m |
the number of cases per observation for binomial regression. |
a |
the scale for negative binomial regression. |
verbose |
a flag to control the amount of output printed by the function. |
The containing package, msme, provides the needed functions to use the irls function to fit the Poisson, negative binomial (2), Bernoulli, and binomial families, and supports the use of the identity, log, logit, probit, complementary log-log, inverse, inverse^2, and negative binomial link functions. All statistics are computed at the final iteration of the IRLS algorithm. The convergence criterion is the magnitude of the change in deviance. The object returned by the function is designed to be reported by the print.glm function.
coefficients |
parameter estimates. |
se.beta.hat |
standard errors of parameter estimates. |
model |
the final, weighted linear model. |
call |
the function call used to create the object. |
nobs |
the number of observations. |
eta |
the linear predictor at the final iteration. |
mu |
the estimated mean at the final iteration. |
df.residual |
the residual degrees of freedom. |
df.null |
the degrees of freedom for the null model. |
deviance |
the residual deviance. |
null.deviance |
a place-holder for the null deviance - returned as NA |
p.dispersion |
Pearsons's Chi-squared statistic. |
pearson |
Pearson's deviance. |
loglik |
the maximized log-likelihood. |
family |
the chosen family. |
X |
the design matrix. |
i |
the number of iterations required for convergence. |
residuals |
the deviance residuals. |
aic |
Akaike's Information Criterion. |
Andrew Robinson and Joe Hilbe.
Hilbe, J.M., and Robinson, A.P. 2013. Methods of Statistical Model Estimation. Chapman & Hall / CRC.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.