This function takes an "mlm" object, fit by lm
with a multivariate response.
The goal is to return something analogous to glance.lm
for a univariate response linear model.
Arguments
- x
An
mlm
object created bylm
, i.e., with a multivariate response.- ...
Additional arguments. Not used.
Value
A tibble
with one row for each response variable and the columns:
r.squared
R squared statistic, or the percent of variation explained by the model.
adj.r.squared
Adjusted R squared statistic, which is like the R squared statistic except taking degrees of freedom into account.
sigma
Estimated standard error of the residuals
fstatitic
Overall F statistic for the model
numdf
Numerator degrees of freedom for the overall test
dendf
Denominator degrees of freedom for the overall test
p.value
P-value corresponding to the F statistic
nobs
Number of observations used
Details
In the multivariate case, it returns a tibble
with one row for each
response variable, containing goodness of fit measures, F-tests and p-values.
Examples
iris.mod <- lm(cbind(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) ~ Species, data=iris)
glance(iris.mod)
#> # A tibble: 4 × 9
#> response r.squared adj.r.squared sigma fstatistic numdf dendf p.value nobs
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <int>
#> 1 Sepal.Len… 0.619 0.614 0.515 119. 2 147 1.67e-31 150
#> 2 Sepal.Wid… 0.401 0.393 0.340 49.2 2 147 4.49e-17 150
#> 3 Petal.Len… 0.941 0.941 0.430 1180. 2 147 2.86e-91 150
#> 4 Petal.Wid… 0.929 0.928 0.205 960. 2 147 4.17e-85 150