Skip to content

Commit

Permalink
model_parameters.averaging() fails
Browse files Browse the repository at this point in the history
Fixes #1045
  • Loading branch information
strengejacke committed Nov 26, 2024
1 parent 7fc4b8f commit 43301f1
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion R/methods_averaging.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,27 @@ p_value.averaging <- function(model, component = "conditional", ...) {
s <- summary(model)$coefmat.subset
}

# to data frame
s <- as.data.frame(s)

# do we have a p-value column based on t?
pvcn <- which(colnames(s) == "Pr(>|t|)")
# if not, do we have a p-value column based on z?
if (length(pvcn) == 0) {
pvcn <- which(colnames(s) == "Pr(>|z|)")
}
# if not, default to ncol
if (length(pvcn) == 0) {
if (ncol(s) > 4) {
pvcn <- 5
} else {
pvcn <- 4
}
}

.data_frame(
Parameter = .remove_backticks_from_string(params$Parameter),
p = as.vector(s[, 5])
p = as.vector(s[, pvcn])
)
}

Expand Down

0 comments on commit 43301f1

Please sign in to comment.