Glance accepts a model object and returns a tibble::tibble() with exactly one row of model summaries. The summaries are typically goodness of fit measures, p-values for hypothesis tests on residuals, or model convergence information.

Glance never returns information from the original call to the modelling function. This includes the name of the modelling function or any arguments passed to the modelling function.

Glance does not calculate summary measures. Rather, it farms out these computations to appropriate methods and gathers the results together. Sometimes a goodness of fit measure will be undefined. In these cases the measure will be reported as NA.

# S3 method for felm
glance(x, ...)

Arguments

x

A felm object returned from lfe::felm().

...

Additional arguments. Not used. Needed to match generic signature only. Cautionary note: Misspelled arguments will be absorbed in ..., where they will be ignored. If the misspelled argument has a default value, the default value will be used. For example, if you pass conf.lvel = 0.9, all computation will proceed using conf.level = 0.95. Additionally, if you pass newdata = my_tibble to an augment() method that does not accept a newdata argument, it will use the default value for the data argument.

Value

A tibble::tibble() with exactly one row and columns:

adj.r.squared

Adjusted R squared statistic, which is like the R squared statistic except taking degrees of freedom into account.

df

Degrees of freedom used by the model.

df.residual

Residual degrees of freedom for the model.

p.value

Needs custom info.

r.squared

R squared statistic, or the percent of variation explained by the model. Also known as the coefficient of determination.

sigma

Estimated standard error of the residuals.

statistic

Needs custom info.

Examples

library(lfe) N=1e2 DT <- data.frame( id = sample(5, N, TRUE), v1 = sample(5, N, TRUE), v2 = sample(1e6, N, TRUE), v3 = sample(round(runif(100,max=100),4), N, TRUE), v4 = sample(round(runif(100,max=100),4), N, TRUE) ) result_felm <- felm(v2~v3, DT) tidy(result_felm)
#> # A tibble: 2 x 5 #> term estimate std.error statistic p.value #> <chr> <dbl> <dbl> <dbl> <dbl> #> 1 (Intercept) 562241. 54755. 10.3 3.17e-17 #> 2 v3 -888. 908. -0.978 3.30e- 1
augment(result_felm)
#> # A tibble: 100 x 4 #> v2 v3 .fitted .resid #> <int> <dbl> <dbl> <dbl> #> 1 821154 40.6 526213. 294941. #> 2 223393 85.1 486635. -263242. #> 3 488734 86.1 485774. 2960. #> 4 680551 37.2 529215. 151336. #> 5 978494 5.39 557453. 421041. #> 6 419110 85.1 486635. -67525. #> 7 599775 2.54 559986. 39789. #> 8 883923 64.6 504821. 379102. #> 9 70205 48.5 519199. -448994. #> 10 867484 10.3 553069. 314415. #> # ... with 90 more rows
result_felm <- felm(v2~v3|id+v1, DT) tidy(result_felm, fe = TRUE)
#> # A tibble: 11 x 7 #> term estimate std.error statistic p.value N comp #> <chr> <dbl> <dbl> <dbl> <dbl> <int> <dbl> #> 1 v3 -732. 926. -0.791 0.431 NA NA #> 2 id.1 48789. 89124. 0.547 0.592 15 1 #> 3 id.2 -19449. 98456. -0.198 1.15 13 1 #> 4 id.3 0 0 NaN NaN 29 1 #> 5 id.4 117295. 70146. 1.67 0.109 21 1 #> 6 id.5 56822. 91739. 0.619 0.542 22 1 #> 7 v1.1 617720. 88462. 6.98 0.000000522 22 1 #> 8 v1.2 466268. 77838. 5.99 0.00000604 21 1 #> 9 v1.3 458609. 94434. 4.86 0.000148 17 1 #> 10 v1.4 477556. 92884. 5.14 0.0000816 17 1 #> 11 v1.5 518689. 79890. 6.49 0.00000126 23 1
augment(result_felm)
#> # A tibble: 100 x 6 #> v2 v3 id v1 .fitted .resid #> <int> <dbl> <int> <int> <dbl> <dbl> #> 1 821154 40.6 4 5 606304. 214850. #> 2 223393 85.1 4 3 513620. -290227. #> 3 488734 86.1 4 2 520570. -31836. #> 4 680551 37.2 2 2 419612. 260939. #> 5 978494 5.39 3 5 514744. 463750. #> 6 419110 85.1 5 3 453147. -34037. #> 7 599775 2.54 4 2 581705. 18070. #> 8 883923 64.6 4 2 536260. 347663. #> 9 70205 48.5 2 4 422649. -352444. #> 10 867484 10.3 4 4 587294. 280190. #> # ... with 90 more rows
v1<-DT$v1 v2 <- DT$v2 v3 <- DT$v3 id <- DT$id result_felm <- felm(v2~v3|id+v1) tidy(result_felm)
#> # A tibble: 1 x 5 #> term estimate std.error statistic p.value #> <chr> <dbl> <dbl> <dbl> <dbl> #> 1 v3 -732. 926. -0.791 0.431
augment(result_felm)
#> # A tibble: 100 x 6 #> v2 v3 id v1 .fitted .resid #> <int> <dbl> <int> <int> <dbl> <dbl> #> 1 821154 40.6 4 5 606304. 214850. #> 2 223393 85.1 4 3 513620. -290227. #> 3 488734 86.1 4 2 520570. -31836. #> 4 680551 37.2 2 2 419612. 260939. #> 5 978494 5.39 3 5 514744. 463750. #> 6 419110 85.1 5 3 453147. -34037. #> 7 599775 2.54 4 2 581705. 18070. #> 8 883923 64.6 4 2 536260. 347663. #> 9 70205 48.5 2 4 422649. -352444. #> 10 867484 10.3 4 4 587294. 280190. #> # ... with 90 more rows
glance(result_felm)
#> # A tibble: 1 x 7 #> r.squared adj.r.squared sigma statistic p.value df df.residual #> <dbl> <dbl> <dbl> <dbl> <dbl> <int> <int> #> 1 0.0814 -0.0105 286552. 0.886 0.541 90 90