Skip to contents

Implements the generics::glance() generic.

Usage

# S3 method for class 'panglm'
glance(x, ...)

Arguments

x

a "panglm" fit

...

unused

Value

a one-row data.frame including log-likelihood, AIC, BIC, the likelihood parameter count when a likelihood is available, R-squared and adjusted R-squared (see Details), and theta, the NB2 dispersion parameter of pooled, fixed-effects and random-slope negative binomial fits (NA otherwise)

Details

r.squared is 1 - RSS / TSS on the scale of fitted() and the outcome. For Gaussian fixed-effects fits the fitted values include the absorbed individual (and, with effect = "twoways", time) effects, so r.squared is the R-squared of the dummy-variable regression, fixest::r2(type = "r2"), not the within R-squared reported by plm. adj.r.squared is 1 - (1 - R^2) (n - 1) / df, with df the residual degrees of freedom of the fit, which count the absorbed effects, as fixest::r2(type = "ar2"). For non-Gaussian families both are Gaussian-style pseudo-R-squared measures, not likelihood based.

Examples

data(copd)
fit <- panglm(fev1 ~ treatment + age + smoker + crp, data = copd,
              index = c("id", "visit"), model = "pooling", family = "gaussian")
if (requireNamespace("generics", quietly = TRUE)) {
  generics::glance(fit)
}
#>     model     effect   family     link vcov.type    logLik      AIC      BIC
#> 1 pooling individual gaussian identity classical -189.5639 391.1278 413.3505
#>   df.logLik df.residual r.squared adj.r.squared nobs n.groups theta
#> 1         6         295 0.2417961     0.2315154  300       60    NA