Skip to content

Commit

Permalink
Merge pull request #956 from strengejacke/check_against_ggeffects
Browse files Browse the repository at this point in the history
Check against V2 ggeffects
  • Loading branch information
strengejacke authored Nov 29, 2024
2 parents d61e1ae + d487b64 commit 1cccaf0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
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.

0 comments on commit 1cccaf0

Please sign in to comment.