Learn R Programming

valueprhr (version 0.1.0)

compare_models: Compare All Models

Description

Generates a comprehensive comparison table of all fitted models.

Usage

compare_models(
  twoway_result = NULL,
  mundlak_result = NULL,
  bayes_result = NULL,
  pls_result = NULL
)

Value

A data frame with model comparison metrics.

Arguments

twoway_result

Result from fit_twoway_fe (or NULL).

mundlak_result

Result from fit_mundlak_cre (or NULL).

bayes_result

Result from fit_bayesian_hierarchical (or NULL).

pls_result

Result from fit_pls_multivariate (or NULL).

Examples

Run this code
# \donttest{
if (requireNamespace("plm", quietly = TRUE)) {
  set.seed(123)
  panel <- data.frame(
    year = rep(2000:2019, 5),
    sector = rep(LETTERS[1:5], each = 20),
    log_direct = rnorm(100, 5, 0.5),
    log_production = rnorm(100, 5, 0.5)
  )
  panel$log_production <- panel$log_direct * 0.95 + rnorm(100, 0, 0.1)

  twoway <- fit_twoway_fe(panel)
  mundlak <- fit_mundlak_cre(panel)

  comparison <- compare_models(
    twoway_result = twoway,
    mundlak_result = mundlak
  )
  print(comparison)
}
# }

Run the code above in your browser using DataLab