Nothing
# Model classes that inherit an apa7 method that does not fit them. Without
# these methods, they would get a table with wrong labels or notes, without
# an error.
# Models that are not supported ----
#' Why a model class is not supported
#' @keywords internal
#' @noRd
unsupported_reasons <- list(
clogit = c(
"Conditional logistic regression models ({.cls clogit}) are not supported yet.",
i = "They inherit from Cox models, but their exponentiated coefficients are odds ratios, not hazard ratios."
),
tobit = c(
"Tobit models ({.cls tobit}) are not supported yet.",
i = "They inherit from parametric survival models, but their coefficients are effects on a censored outcome, not changes in log survival time."
),
svyglm = c(
"Survey-weighted generalized linear models ({.cls svyglm}) are not supported yet.",
i = "Their standard errors and tests depend on the survey design, which the table and its note would not describe."
)
)
#' Stop for a model class that is not supported
#' @param fit a model
#' @keywords internal
#' @noRd
stop_unsupported <- function(fit, call = rlang::caller_env()) {
class_name <- intersect(class(fit), names(unsupported_reasons))[1]
reason <- unsupported_reasons[[class_name]]
cli::cli_abort(
c(
reason,
i = "{.fn parameters::model_parameters} and {.fn performance::model_performance} support them, and their output can be passed to {.fn apa_flextable}."
),
call = call
)
}
#' Is a model of a class that is not supported?
#' @keywords internal
#' @noRd
is_unsupported_model <- function(fit) {
inherits(fit, names(unsupported_reasons))
}
# Methods that stop for unsupported models ----
#' @export
#' @noRd
apa_parameters.clogit <- function(fit, ...) stop_unsupported(fit)
#' @export
#' @noRd
apa_parameters.tobit <- function(fit, ...) stop_unsupported(fit)
#' @export
#' @noRd
apa_parameters.svyglm <- function(fit, ...) stop_unsupported(fit)
#' @export
#' @noRd
apa_performance.clogit <- function(fit, ...) stop_unsupported(fit)
#' @export
#' @noRd
apa_performance.tobit <- function(fit, ...) stop_unsupported(fit)
#' @export
#' @noRd
apa_performance.svyglm <- function(fit, ...) stop_unsupported(fit)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.