Skip to content

Commit

Permalink
reorganize
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 22, 2024
1 parent 1807fc9 commit d874d74
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions R/3_p_value.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ p_value.default <- function(model,
.is_model_valid(model)

dots <- list(...)
p <- NULL

if (is.character(method)) {
method <- tolower(method)
Expand All @@ -66,33 +67,29 @@ p_value.default <- function(model,
}

if (method == "ml1") {
p <- p_value_ml1(model)
return(p)
return(p_value_ml1(model))
}

if (method == "betwithin") {
p <- p_value_betwithin(model)
return(p)
return(p_value_betwithin(model))
}

if (method %in% c("residual", "wald", "normal", "satterthwaite", "kenward", "kr")) {
if (is.null(dof)) {
dof <- degrees_of_freedom(model, method = method, verbose = FALSE)
}
p <- .p_value_dof(
return(.p_value_dof(
model,
dof = dof,
method = method,
component = component,
verbose = verbose,
...
)
return(p)
))
}

if (method %in% c("hdi", "eti", "si", "bci", "bcai", "quantile")) {
p <- bayestestR::p_direction(model, ...)
return(p)
return(bayestestR::p_direction(model, ...))
}

# robust standard errors
Expand Down

0 comments on commit d874d74

Please sign in to comment.