Description Usage Arguments Value Examples
The MSE, defined as the sum of the squared residuals divided by n-p
(n
= number of observations, p
= number of regression
coefficients), is an unbiased estimator for the error variance in a linear
regression model. This is a convenience function that extracts the MSE from
a fitted lm
or glm
object. The code is
rev(anova(model.fit)$"Mean Sq")[1]
if model.fit
is a
lm
object and
sum(model.fit$residuals^2) / model.fit$df.residual
if model.fit
is a glm
object.
1 |
model.fit |
Fitted regression model returned from
|
var.estimate |
If |
If var.estimate = FALSE
, numeric value indicating the MSE; if
var.estimate = TRUE
, named numeric vector indicating both the MSE and
a variance estimate for the error variance.
1 2 3 4 5 6 7 8 9 10 11 12 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.