Tidy summarizes information about the components of a model. A model component might be a single term in a regression, a single hypothesis, a cluster, or a class. Exactly what tidy considers to be a model component varies cross models but is usually self-evident. If a model has several distinct types of components, you will need to specify which components to return.

# S3 method for felm
tidy(x, conf.int = FALSE, conf.level = 0.95,
  fe = FALSE, ...)

Arguments

x

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

conf.int

Logical indicating whether or not to include a confidence interval in the tidied output. Defaults to FALSE.

conf.level

The confidence level to use for the confidence interval if conf.int = TRUE. Must be strictly greater than 0 and less than 1. Defaults to 0.95, which corresponds to a 95 percent confidence interval.

fe

Logical indicating whether or not to include estimates of fixed effects. Defaults to FALSE.

...

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.

See also

tidy(), lfe::felm()

Other felm tidiers: augment.felm

Value

A tibble::tibble() with columns:

conf.high

The upper end of a confidence interval for the term under consideration. Included only if `conf.int = TRUE`.

conf.low

The lower end of a confidence interval for the term under consideration. Included only if `conf.int = TRUE`.

estimate

The estimated value of the regression term.

p.value

The two-sided p-value associated with the observed statistic.

statistic

The value of a T-statistic to use in a hypothesis that the regression term is non-zero.

std.error

The standard error of the regression term.

term

The name of the regression term.

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) 438525. 56854. 7.71 1.03e-11 #> 2 v3 870. 880. 0.989 3.25e- 1
augment(result_felm)
#> # A tibble: 100 x 4 #> v2 v3 .fitted .resid #> <int> <dbl> <dbl> <dbl> #> 1 538896 4.29 442256. 96640. #> 2 814776 19.1 455148. 359628. #> 3 532207 92.2 518802. 13405. #> 4 267890 1.19 439559. -171669. #> 5 160723 1.19 439559. -278836. #> 6 296299 88.4 515469. -219170. #> 7 671340 95.0 521176. 150164. #> 8 245501 57.1 488230. -242729. #> 9 599490 11.8 448805. 150685. #> 10 166079 87.5 514724. -348645. #> # ... 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 1063. 912. 1.17 0.247 NA NA #> 2 id.1 401068. 92439. 4.34 0.000354 19 1 #> 3 id.2 477145. 95716. 4.98 0.000163 15 1 #> 4 id.3 364221. 99057. 3.68 0.00108 26 1 #> 5 id.4 427077. 92242. 4.63 0.000208 18 1 #> 6 id.5 506028. 94711. 5.34 0.0000231 22 1 #> 7 v1.1 35059. 95483. 0.367 0.718 17 1 #> 8 v1.2 -36429. 78710. -0.463 1.35 22 1 #> 9 v1.3 -6039. 83748. -0.0721 1.06 17 1 #> 10 v1.4 260. 90135. 0.00289 0.998 17 1 #> 11 v1.5 0 0 NaN NaN 27 1
augment(result_felm)
#> # A tibble: 100 x 6 #> v2 v3 id v1 .fitted .resid #> <int> <dbl> <int> <int> <dbl> <dbl> #> 1 538896 4.29 1 3 399584. 139312. #> 2 814776 19.1 4 4 447634. 367142. #> 3 532207 92.2 3 3 456204. 76003. #> 4 267890 1.19 5 1 542350. -274460. #> 5 160723 1.19 4 2 391911. -231188. #> 6 296299 88.4 3 2 421744. -125445. #> 7 671340 95.0 3 4 465402. 205938. #> 8 245501 57.1 5 4 566981. -321480. #> 9 599490 11.8 2 3 483658. 115832. #> 10 166079 87.5 5 5 599070. -432991. #> # ... 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 1063. 912. 1.17 0.247
augment(result_felm)
#> # A tibble: 100 x 6 #> v2 v3 id v1 .fitted .resid #> <int> <dbl> <int> <int> <dbl> <dbl> #> 1 538896 4.29 1 3 399584. 139312. #> 2 814776 19.1 4 4 447634. 367142. #> 3 532207 92.2 3 3 456204. 76003. #> 4 267890 1.19 5 1 542350. -274460. #> 5 160723 1.19 4 2 391911. -231188. #> 6 296299 88.4 3 2 421744. -125445. #> 7 671340 95.0 3 4 465402. 205938. #> 8 245501 57.1 5 4 566981. -321480. #> 9 599490 11.8 2 3 483658. 115832. #> 10 166079 87.5 5 5 599070. -432991. #> # ... 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.0610 -0.0329 278913. 0.650 0.752 90 90