tidy() and glance() methods for MEstimator and GMMEstimator objects.
These allow deli results to flow into tidyverse pipelines.
Arguments
- x
A fitted
MEstimatororGMMEstimatorobject.- conf.int
Logical. Include confidence intervals? Default
FALSE.- conf.level
Numeric confidence level for intervals. Default
0.95.- ...
Not used.
tidy()requires them to be empty, so that a misspelledconf.intorconf.levelis an error rather than a table silently returned without intervals or at the default level.glance()has no optional argument for a wrong name to displace and ignores them.
Value
tidy(): A data.frame with columnsterm,estimate,std.error,statistic,p.value,s.value. Ifconf.int = TRUE, also includesconf.lowandconf.high. Ap.valuethat underflows to exactly zero is reported as0alongside an infinites.value; sees_values().glance(): A single-row data.frame with model-level summaries:nobs,npar,estimator,finite_correction, and the Hansen J-statistic of an over-identified GMM fit inj_statistic,j_dfandj_p_value. The three J columns are present on every fit and hold the typed missing value of their own type where there is no such statistic, which is every M-estimation fit and every just-identified orsubsetGMM fit; seeGMMEstimator()for what the statistic reads and where it is left unset.
See also
deli-augment, the third broom generic, which returns the
observation-level fitted values, intervals, and residuals, and reexports
for the generics themselves, which deli re-exports so that tidy() and
glance() resolve with deli alone attached.
Examples
fit <- m_estimate(mpg ~ wt + hp, data = mtcars, .ee = ee_regression,
model = "linear")
tidy(fit, conf.int = TRUE)
#> term estimate std.error statistic p.value s.value
#> 1 (Intercept) 37.22727012 1.938920511 19.199998 3.701056e-82 270.51017
#> 2 wt -3.87783074 0.619927275 -6.255299 3.967539e-10 31.23104
#> 3 hp -0.03177295 0.006646057 -4.780721 1.746674e-06 19.12696
#> conf.low conf.high
#> 1 33.42705575 41.02748449
#> 2 -5.09286587 -2.66279561
#> 3 -0.04479898 -0.01874691
glance(fit)
#> nobs npar estimator finite_correction j_statistic j_df j_p_value
#> 1 32 3 MEstimator <NA> NA NA NA