Skip to content

Commit

Permalink
ggcoefstats supports car anova objects
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Sep 24, 2018
1 parent abe083f commit d76b95d
Show file tree
Hide file tree
Showing 30 changed files with 534 additions and 502 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Imports:
tidyr (>= 0.8.1),
WRS2 (>= 0.10-0)
Suggests:
car (>= 3.0-2),
devtools,
ggplot2movies,
ggthemes (>= 4.0.0),
Expand Down
8 changes: 4 additions & 4 deletions R/ggcoefstats.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
#' \url{https://cran.r-project.org/package=ggstatsplot/vignettes/ggcoefstats.html}
#'
#' @examples
#'
#'
#' set.seed(123)
#' ggcoefstats(x = lm(formula = mpg ~ cyl * am, data = mtcars))
#' @export
Expand All @@ -148,7 +148,7 @@ ggcoefstats <- function(x,
p.kr = TRUE,
coefficient.type = "beta",
effsize = "eta",
nboot = 1000,
nboot = 500,
point.color = "blue",
point.size = 3,
point.shape = 16,
Expand Down Expand Up @@ -209,7 +209,7 @@ ggcoefstats <- function(x,
unsupported.mods <- c("glht", "kmeans")

# models for which glance is not supported
noglance.mods <- c("aovlist")
noglance.mods <- c("aovlist", "anova")

# models for which the diagnostics is not available (AIC, BIC, loglik)
nodiagnostics.mods <- c("lmRob", "glmRob")
Expand All @@ -223,7 +223,7 @@ ggcoefstats <- function(x,
z.mods <- c("clm", "clmm")

# models for which statistic is F-value
f.mods <- c("aov", "aovlist")
f.mods <- c("aov", "aovlist", "anova")

# models for which there is no clear t-or z-statistic
# which statistic to use will be decided based on the family used
Expand Down
7 changes: 4 additions & 3 deletions R/helpers_effsize_ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ robcor_ci <- function(data,
#' @param conf.level Numeric specifying Level of confidence for the confidence
#' interval (Default: `0.95`).
#' @param nboot Number of bootstrap samples for confidence intervals for partial
#' eta-squared and omega-squared (Default: `1000`).
#' eta-squared and omega-squared (Default: `500`).
#'
#' @importFrom sjstats eta_sq
#' @importFrom sjstats omega_sq
Expand All @@ -656,12 +656,13 @@ lm_effsize_ci <-
effsize = "eta",
partial = TRUE,
conf.level = 0.95,
nboot = 1000) {
nboot = 500) {

# based on the class, get the tidy output using broom
if (class(object)[[1]] == "lm") {
aov_df <-
broom::tidy(stats::anova(object = object))
} else if (class(object)[[1]] == "aov") {
} else if (class(object)[[1]] %in% c("aov", "anova")) {
aov_df <- broom::tidy(x = object)
} else if (class(object)[[1]] == "aovlist") {
aov_df <- broom::tidy(x = object) %>%
Expand Down
4 changes: 2 additions & 2 deletions docs/articles/combine_plots.html

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

4 changes: 2 additions & 2 deletions docs/articles/ggbetweenstats.html

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

935 changes: 475 additions & 460 deletions docs/articles/ggcoefstats.html

Large diffs are not rendered by default.

Binary file modified docs/articles/ggcoefstats_files/figure-html/aov-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/ggcoefstats_files/figure-html/aovlist-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/articles/ggcorrmat.html

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

4 changes: 2 additions & 2 deletions docs/articles/gghistostats.html

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

Binary file modified docs/articles/gghistostats_files/figure-html/grouped1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/articles/ggpiestats.html

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

4 changes: 2 additions & 2 deletions docs/articles/ggscatterstats.html

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

4 changes: 2 additions & 2 deletions docs/articles/plot_design.html

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

4 changes: 2 additions & 2 deletions docs/articles/purrr_examples.html

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

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/articles/theme_ggstatsplot.html

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

Loading

0 comments on commit d76b95d

Please sign in to comment.