1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
# classes: .mvord
#################### .mvord
#' @export
model_parameters.mvord <- function(model,
ci = 0.95,
component = "all",
standardize = NULL,
exponentiate = FALSE,
p_adjust = NULL,
include_info = getOption("parameters_info", FALSE),
keep = NULL,
drop = NULL,
verbose = TRUE,
...) {
component <- insight::validate_argument(component, c("all", "conditional", "thresholds", "correlation"))
out <- .model_parameters_generic(
model = model,
ci = ci,
component = component,
bootstrap = FALSE,
iterations = 10,
merge_by = c("Parameter", "Component", "Response"),
standardize = standardize,
exponentiate = exponentiate,
p_adjust = p_adjust,
keep_parameters = keep,
drop_parameters = drop,
include_info = include_info,
...
)
attr(out, "object_name") <- insight::safe_deparse_symbol(substitute(model))
out
}
#' @export
standard_error.mvord <- function(model, component = c("all", "conditional", "thresholds", "correlation"), ...) {
component <- match.arg(component)
params <- insight::get_parameters(model, component = "all")
junk <- utils::capture.output({
s <- summary(model)
})
params$SE <- c(
unname(s$thresholds[, "Std. Error"]),
unname(s$coefficients[, "Std. Error"]),
unname(s$error.structure[, "Std. Error"])
)
params <- params[c("Parameter", "SE", "Component", "Response")]
if (insight::n_unique(params$Response) == 1) {
params$Response <- NULL
}
if (component != "all") {
params <- params[params$Component == component, , drop = FALSE]
}
insight::text_remove_backticks(params, verbose = FALSE)
}
#' @export
p_value.mvord <- function(model, component = c("all", "conditional", "thresholds", "correlation"), ...) {
component <- match.arg(component)
params <- insight::get_parameters(model, component = "all")
junk <- utils::capture.output({
s <- summary(model)
})
params$p <- c(
unname(s$thresholds[, "Pr(>|z|)"]),
unname(s$coefficients[, "Pr(>|z|)"]),
unname(s$error.structure[, "Pr(>|z|)"])
)
params <- params[c("Parameter", "p", "Component", "Response")]
if (insight::n_unique(params$Response) == 1) {
params$Response <- NULL
}
if (component != "all") {
params <- params[params$Component == component, , drop = FALSE]
}
insight::text_remove_backticks(params, verbose = FALSE)
}
#' @export
simulate_model.mvord <- function(model, iterations = 1000, component = c("all", "conditional", "thresholds", "correlation"), ...) {
component <- match.arg(component)
out <- .simulate_model(model, iterations, component = component, ...)
class(out) <- c("parameters_simulate_model", class(out))
attr(out, "object_name") <- insight::safe_deparse_symbol(substitute(model))
out
}
|