Extended summary information for an object of class "lm".

# S3 method for lm
info(x)

Arguments

x

an object of class "lm"

Value

A list of class c("info.lm", "list").

  • overall

  • fit.indices

  • F.test

  • anova.table

  • coefficient.table

Details

The function info.lm produces a summary for a linear model fitted with the lm or regress function. There are five sections.

Overall

Model formula, data frame, and sample size (N).

Fit Indices

R squared, adjusted R squared, Akaike's information criterion (AIC), root mean square error (RMSE), and mean absolute deviation (MAE).

Omnibus Test

F-statistic, degrees of freedom, p-value.

Analysis of Variance

ANOVA table with type III (marginal) effects.

Regression Coefficients

Regression coefficients (B), standardized regression coefficients (B*) standard errors (SE), t-values, and p-values.

The ANOVA table is obtained from the Anova function in the car package. The standardized regression coefficients are obtained for the lm.beta function in the lm.beta package.

See also

Examples

fit <- lm(mpg ~ hp + wt + accel + origin, data = auto_mpg)
info(fit)
#> MULTIPLE REGRESSION SUMMARY 
#> Model: mpg ~ hp + wt + accel + origin
#> Data : auto_mpg
#> N    : 388
#> 
#> Fit Indices 
#>  R.Squared Adj.R.Squared  AIC RMSE  MAE
#>      0.718         0.715 2217 4.14 3.15
#> 
#> Omnibus Test 
#> F(5,382) = 194.921, p < <2e-16  *** 
#> 
#> Anova Table (type III tests) 
#>               Sum Sq  DF F value Pr(>F)    
#> (Intercept) 5363.242   1 308.296 <0.001 ***
#> hp           217.649   1  12.511 <0.001 ***
#> wt          1007.306   1  57.903 <0.001 ***
#> accel          0.952   1   0.055  0.815    
#> origin       307.094   2   8.826 <0.001 ***
#> Residuals   6645.428 382                   
#> 
#> Regression Coefficients 
#>                    B      B*       SE      t Pr(>|t|)    
#> (Intercept) 43.26563  0.0000 2.464104 17.558 5.04e-51 ***
#> hp          -0.05632 -0.2783 0.015922 -3.537 4.54e-04 ***
#> wt          -0.00477 -0.5180 0.000627 -7.609 2.17e-13 ***
#> accel       -0.02862 -0.0101 0.122391 -0.234 8.15e-01    
#> origin2      0.96892  0.0472 0.646763  1.498 1.35e-01    
#> origin3      2.76148  0.1419 0.659001  4.190 3.46e-05 ***