Nothing
#| label = "setup", #| message = FALSE, #| warning = FALSE, #| include = FALSE, #| echo = FALSE source("../setup.R") pkgs <- c( "ggplot2", "metaplus" ) successfully_loaded <- purrr::map_lgl(pkgs, requireNamespace, quietly = TRUE) can_evaluate <- all(successfully_loaded) if (can_evaluate) { purrr::walk(pkgs, library, character.only = TRUE) } else { knitr::opts_chunk$set(eval = FALSE) }
This vignette can be cited as:
#| label = "citation", #| echo = FALSE, #| comment = "" citation("statsExpressions")
#| label = "onesample", #| file = "../../man/examples/examples-one-sample-test.R"
#| label = "twosample_w", #| file = "../../man/examples/examples-two-sample-test-within.R"
#| label = "twosample_b", #| file = "../../man/examples/examples-two-sample-test-between.R"
#| label = "anova_w" suppressPackageStartupMessages(library(afex)) # ----------------------- parametric --------------------------------------- set.seed(123) oneway_anova( data = bugs_long, x = condition, y = desire, paired = TRUE, subject.id = subject, type = "p" ) # ----------------------- non-parametric ----------------------------------- set.seed(123) oneway_anova( data = bugs_long, x = condition, y = desire, paired = TRUE, subject.id = subject, type = "np" ) # ----------------------- robust -------------------------------------------- set.seed(123) oneway_anova( data = bugs_long, x = condition, y = desire, paired = TRUE, subject.id = subject, type = "r" ) # ----------------------- Bayesian --------------------------------------- set.seed(123) oneway_anova( data = bugs_long, x = condition, y = desire, paired = TRUE, subject.id = subject, type = "bayes" )
#| label = "anova_b" # ----------------------- parametric --------------------------------------- # unequal variance set.seed(123) oneway_anova( data = iris, x = Species, y = Sepal.Length, type = "p" ) # equal variance set.seed(123) oneway_anova( data = iris, x = Species, y = Sepal.Length, var.equal = TRUE, type = "p" ) # ----------------------- non-parametric ----------------------------------- set.seed(123) oneway_anova( data = iris, x = Species, y = Sepal.Length, type = "np" ) # ----------------------- robust -------------------------------------------- set.seed(123) oneway_anova( data = iris, x = Species, y = Sepal.Length, type = "r" ) # ----------------------- Bayesian --------------------------------------- set.seed(123) oneway_anova( data = iris, x = Species, y = Sepal.Length, type = "bayes" )
#| label = "crosstabs", #| file = "../../man/examples/examples-contingency-table.R"
#| label = "corr", #| file = "../../man/examples/examples-corr-test.R"
#| label = "meta" library(metaplus) # renaming columns to `{statsExpressions}` conventions df <- dplyr::rename(mag, estimate = yi, std.error = sei) # ----------------------- parametric --------------------------------------- set.seed(123) meta_analysis(df, type = "parametric") # ----------------------- robust -------------------------------------------- set.seed(123) meta_analysis(df, type = "robust") # ----------------------- Bayesian --------------------------------------- # suppress warnings about divergent transitions after warmup set.seed(123) suppressWarnings(meta_analysis(df, type = "bayes"))
#| label = "centrality", #| file = "../../man/examples/examples-centrality-description.R"
# ----------------------- parametric ----------------------- # if `var.equal = TRUE`, then Student's *t*-test will be run pairwise_comparisons( data = ggplot2::msleep, x = vore, y = brainwt, type = "parametric", var.equal = TRUE, paired = FALSE, p.adjust.method = "bonferroni" ) # if `var.equal = FALSE`, then Games-Howell test will be run pairwise_comparisons( data = ggplot2::msleep, x = vore, y = brainwt, type = "parametric", var.equal = FALSE, paired = FALSE, p.adjust.method = "bonferroni" ) # ----------------------- non-parametric ------------------- pairwise_comparisons( data = ggplot2::msleep, x = vore, y = brainwt, type = "nonparametric", paired = FALSE, p.adjust.method = "none" ) # ----------------------- robust --------------------------- pairwise_comparisons( data = ggplot2::msleep, x = vore, y = brainwt, type = "robust", paired = FALSE, p.adjust.method = "fdr" ) # ----------------------- Bayesian ------------------------- pairwise_comparisons( data = ggplot2::msleep, x = vore, y = brainwt, type = "bayes", paired = FALSE )
# ----------------------- parametric ----------------------- pairwise_comparisons( data = bugs_long, x = condition, y = desire, subject.id = subject, type = "parametric", paired = TRUE, p.adjust.method = "BH" ) # ----------------------- non-parametric ------------------- pairwise_comparisons( data = bugs_long, x = condition, y = desire, subject.id = subject, type = "nonparametric", paired = TRUE, p.adjust.method = "BY" ) # ----------------------- robust --------------------------- pairwise_comparisons( data = bugs_long, x = condition, y = desire, subject.id = subject, type = "robust", paired = TRUE, p.adjust.method = "hommel" ) # ----------------------- Bayesian ------------------------- pairwise_comparisons( data = bugs_long, x = condition, y = desire, subject.id = subject, type = "bayes", paired = TRUE, bf.prior = 0.77 )
If you find any bugs or have any suggestions/remarks, please file an issue on GitHub: https://github.com/IndrajeetPatil/statsExpressions/issues
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.