diff --git a/NAMESPACE b/NAMESPACE index a4ef304d9..ca6fa4760 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -274,7 +274,9 @@ S3method(model_parameters,emm_list) S3method(model_parameters,epi.2by2) S3method(model_parameters,fa) S3method(model_parameters,fa.ci) +S3method(model_parameters,feglm) S3method(model_parameters,fitdistr) +S3method(model_parameters,fixest) S3method(model_parameters,fixest_multi) S3method(model_parameters,flac) S3method(model_parameters,flic) diff --git a/R/methods_fixest.R b/R/methods_fixest.R index 7add00757..0cd3e389e 100644 --- a/R/methods_fixest.R +++ b/R/methods_fixest.R @@ -1,5 +1,66 @@ # .fixest ----------------------- +#' @export +model_parameters.fixest <- function(model, + ci = 0.95, + ci_method = NULL, + bootstrap = FALSE, + iterations = 1000, + standardize = NULL, + exponentiate = FALSE, + p_adjust = NULL, + summary = getOption("parameters_summary", FALSE), + keep = NULL, + drop = NULL, + verbose = TRUE, + vcov = NULL, + vcov_args = NULL, + ...) { + # default ci-method, based on statistic + if (is.null(ci_method)) { + if (identical(insight::find_statistic(model), "t-statistic")) { + ci_method <- "residual" + } else { + ci_method <- "wald" + } + } + + # extract model parameters table, as data frame + out <- tryCatch( + { + .model_parameters_generic( + model = model, + ci = ci, + ci_method = ci_method, + bootstrap = bootstrap, + iterations = iterations, + merge_by = "Parameter", + standardize = standardize, + exponentiate = exponentiate, + p_adjust = p_adjust, + summary = summary, + keep_parameters = keep, + drop_parameters = drop, + vcov = vcov, + vcov_args = vcov_args, + verbose = verbose, + ... + ) + }, + error = function(e) { + NULL + } + ) + + if (is.null(out)) { + insight::format_error("Something went wrong... :-/") + } + + attr(out, "object_name") <- insight::safe_deparse_symbol(substitute(model)) + out +} + + #' @export standard_error.fixest <- function(model, vcov = NULL, vcov_args = NULL, ...) { params <- insight::get_parameters(model) @@ -45,6 +106,9 @@ degrees_of_freedom.fixest <- function(model, method = "wald", ...) { # .feglm ----------------------- +#' @export +model_parameters.feglm <- model_parameters.fixest + #' @export standard_error.feglm <- function(model, ...) { stats <- stats::coef(summary(model)) diff --git a/man/p_function.Rd b/man/p_function.Rd index 6748d2c37..c84e61246 100644 --- a/man/p_function.Rd +++ b/man/p_function.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/p_function.r +% Please edit documentation in R/p_function.R \name{p_function} \alias{p_function} \alias{consonance_function}