Skip to content

Commit

Permalink
update p_value and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 23, 2024
1 parent 38de624 commit c2d07e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/3_p_value.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ p_value.default <- function(model,

if (method %in% c("residual", "wald", "normal", "satterthwaite", "kenward", "kr")) {
if (is.null(dof)) {
dof <- degrees_of_freedom(model, method = method, verbose = FALSE)
dof <- insight::get_df(x = model, type = method, verbose = FALSE)
}
return(.p_value_dof(
model,
Expand Down Expand Up @@ -111,7 +111,7 @@ p_value.default <- function(model,
se <- do.call("standard_error", fun_args)
}

dof <- degrees_of_freedom(model, method = "wald", verbose = FALSE)
dof <- insight::get_df(x = model, type = "wald", verbose = FALSE)
se <- merge(se, co, sort = FALSE)
se$Statistic <- se$Estimate / se$SE
se$p <- 2 * stats::pt(abs(se$Statistic), df = dof, lower.tail = FALSE)
Expand Down
2 changes: 1 addition & 1 deletion R/ci_generic.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
# check if we have a valid dof vector
if (is.null(dof)) {
# residual df
dof <- degrees_of_freedom(model, method = method, verbose = FALSE)
dof <- insight::get_df(x = model, type = method, verbose = FALSE)
# make sure we have a value for degrees of freedom
if (is.null(dof) || length(dof) == 0 || .is_chi2_model(model, dof)) {
dof <- Inf
Expand Down

0 comments on commit c2d07e6

Please sign in to comment.