hatvalues.msme {msme} | R Documentation |
Function to return the hat matrix of a msme-class model.
Description
This function uses QR decomposition to determine the hat matrix of a model given its design matrix X. It is specific to objects of class msme.
Usage
## S3 method for class 'msme'
hatvalues(model, ...)
Arguments
model |
A fitted model of class msme. |
... |
other arguments, retained for compatibility with generic method. |
Value
An n*n matrix of hat values, where n is the number of observations used to fit the model. Needed to standardize the residuals.
Note
Leverages can be obtained as the diagonal of the output. See the examples.
Author(s)
Andrew Robinson and Joe Hilbe.
References
Hilbe, J.M., and Robinson, A.P. 2013. Methods of Statistical Model Estimation. Chapman & Hall / CRC.
See Also
Examples
data(medpar)
ml.poi <- ml_glm(los ~ hmo + white,
family = "poisson",
link = "log",
data = medpar)
str(diag(hatvalues(ml.poi)))
[Package msme version 0.5.3 Index]