Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check against V2 ggeffects #956

Merged
merged 4 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: sjPlot
Type: Package
Encoding: UTF-8
Title: Data Visualization for Statistics in Social Science
Version: 2.8.16.2
Version: 2.8.16.3
Authors@R: c(
person("Daniel", "Lüdecke", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-8895-3206")),
person("Alexander", "Bartel", role = "ctb", comment = c(ORCID = "0000-0002-1280-6138")),
Expand Down Expand Up @@ -71,5 +71,6 @@ Suggests:
testthat
URL: https://strengejacke.github.io/sjPlot/
BugReports: https://github.com/strengejacke/sjPlot/issues
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
VignetteBuilder: knitr
Remotes: strengejacke/ggeffects
8 changes: 4 additions & 4 deletions R/plot_grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
#'
#' # plot marginal effects for each predictor, each as single plot
#' p1 <- ggpredict(fit, "c12hour") %>%
#' plot(show.y.title = FALSE, show.title = FALSE)
#' plot(show_y_title = FALSE, show_title = FALSE)
#' p2 <- ggpredict(fit, "e17age") %>%
#' plot(show.y.title = FALSE, show.title = FALSE)
#' plot(show_y_title = FALSE, show_title = FALSE)
#' p3 <- ggpredict(fit, "e42dep") %>%
#' plot(show.y.title = FALSE, show.title = FALSE)
#' plot(show_y_title = FALSE, show_title = FALSE)
#' p4 <- ggpredict(fit, "neg_c_7") %>%
#' plot(show.y.title = FALSE, show.title = FALSE)
#' plot(show_y_title = FALSE, show_title = FALSE)
#'
#' # plot grid
#' plot_grid(list(p1, p2, p3, p4))
Expand Down
6 changes: 6 additions & 0 deletions R/plot_type_eff.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ plot_type_eff <- function(type,

if (missing(facets) || is.null(facets)) facets <- FALSE

pred.type <- switch(pred.type,
fe = "fixed",
re = "random",
pred.type
)

if (type == "pred") {
dat <- ggeffects::ggpredict(
model = model,
Expand Down
5 changes: 5 additions & 0 deletions R/plot_type_int.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ plot_type_int <- function(model,


# compute marginal effects for interaction terms
pred.type <- switch(pred.type,
fe = "fixed",
re = "random",
pred.type
)

dat <- ggeffects::ggpredict(
model = model,
Expand Down
8 changes: 4 additions & 4 deletions man/plot_grid.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading