S3 Generic Functions for Regression Models

Defines S3 generic functions for model comparison, coefficient summaries, goodness-of-fit tables, equation extraction, random-effects summaries, diagnostic plots, variable selection, and methods reporting. Model-specific implementations are supplied by packages that extend these interfaces, allowing a consistent workflow across regression models.


regcore: S3 Generic Functions for Regression Models

R-CMD-check

The regcore package defines S3 generic functions used by regression packages to provide model comparison, coefficient summaries, goodness-of-fit tables, diagnostics, random-effects summaries, and methods reporting. It does not fit regression models or implement statistical tests by itself. Class-specific methods are defined by packages that extend these interfaces.

Available generics

Purpose Functions
Model comparison and selection vuong_test(), pairwise_vuong_test(), stepCriterion()
Model summaries summary_coef(), extract_equations(), random_effects()
Goodness-of-fit and diagnostics gof_tab(), plot_envelope(), df_envelopes(), plot_ranef()
Methods reporting write_methods()

Installation

install.packages("remotes")
remotes::install_github("rpetterle/regcore")

Implementing an S3 method

Other R packages can implement methods for their fitted-model classes. The following example illustrates S3 method dispatch using only base R:

library(regcore)
fit <- structure(list(aic = 12.5), class = "demo_regression")
gof_tab.demo_regression <- function(object, ...) data.frame(AIC = object$aic)
gof_tab(fit)

In a package that imports regcore, register the methods through the downstream package's own NAMESPACE (for example by using roxygen2 @export on the class-specific method). Refer to each generic's help page with ?gof_tab or ?summary_coef.

License

GPL (>= 3).

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("regcore")

0.1.0 by Ricardo Rasmussen Petterle, 21 hours ago


https://github.com/rpetterle/regcore


Report a bug at https://github.com/rpetterle/regcore/issues


Browse source code at https://github.com/cran/regcore


Authors: Ricardo Rasmussen Petterle [aut, cre, cph] (ORCID:


Documentation:   PDF Manual  


GPL (>= 3) license


Suggests testthat


See at CRAN