From 4c3dba5fa211f6b23f4b160af6113b29a4ed13fe Mon Sep 17 00:00:00 2001 From: Robert J Calin-Jageman Date: Sat, 6 Jul 2024 11:49:24 -0500 Subject: [PATCH 1/3] Updates towards 1.0.3 Statpsych has updated to 1.6 with changes in some function names; tweaks made to deal with this (e.g. ci.mean1 became ci.mean) and to some issues with ggplot. --- DESCRIPTION | 2 +- NAMESPACE | 6 +- NEWS.md | 9 ++ R/esci-package.R | 6 +- R/estimate_magnitude.R | 6 +- R/estimate_mdiff_one.R | 4 +- R/estimate_pdiff_one.R | 2 +- R/estimate_proportion.R | 2 +- R/overview.R | 10 +-- R/overview_nominal.R | 4 +- R/plot_aesthetics.R | 101 +++++++++++++++------ R/statpsych_apply.R | 4 +- R/statpsych_wrapper.R | 102 +++++++++++++++++++++- jamovi/jamovimetapdiff.a.yaml | 2 +- man/estimate_magnitude.Rd | 4 +- man/estimate_mdiff_one.Rd | 4 +- man/estimate_pdiff_one.Rd | 2 +- man/estimate_proportion.Rd | 2 +- man/overview.Rd | 4 +- tests/testthat/test_estimate_magnitude.R | 23 +++-- tests/testthat/test_estimate_mdiff_one.R | 15 +++- tests/testthat/test_estimate_pdiff_one.R | 13 ++- tests/testthat/test_estimate_proportion.R | 12 ++- 23 files changed, 260 insertions(+), 79 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b35c04b..ae8e5a0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: esci Type: Package Title: Estimation Statistics with Confidence Intervals -Version: 1.0.2 +Version: 1.0.3 Authors@R: person("Robert", "Calin-Jageman", email = "rcalinjageman@dom.edu", role = c("aut", "cre", "cph")) Description: A collection of functions and 'jamovi' module for the estimation approach to inferential statistics, the approach which emphasizes effect sizes, interval estimates, and meta-analysis. Nearly all functions are based on 'statpsych' and 'metafor'. This package is still under active development, and breaking changes are likely, especially with the plot and hypothesis test functions. Data sets are included for all examples from Cumming & Calin-Jageman (2024) . diff --git a/NAMESPACE b/NAMESPACE index b9e9075..7d20240 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -71,17 +71,13 @@ importFrom(rlang,enquo) importFrom(statpsych,ci.lc.mean.bs) importFrom(statpsych,ci.lc.median.bs) importFrom(statpsych,ci.lc.prop.bs) -importFrom(statpsych,ci.mean1) -importFrom(statpsych,ci.median1) importFrom(statpsych,ci.oddsratio) importFrom(statpsych,ci.phi) -importFrom(statpsych,ci.prop1) importFrom(statpsych,ci.ratio.mean.ps) importFrom(statpsych,ci.ratio.mean2) importFrom(statpsych,ci.ratio.median.ps) importFrom(statpsych,ci.ratio.median2) importFrom(statpsych,ci.stdmean.ps) -importFrom(statpsych,ci.stdmean1) importFrom(stats,aggregate) importFrom(stats,anova) importFrom(stats,complete.cases) @@ -90,10 +86,12 @@ importFrom(stats,cor) importFrom(stats,line) importFrom(stats,median) importFrom(stats,na.omit) +importFrom(stats,pbinom) importFrom(stats,pnorm) importFrom(stats,predict) importFrom(stats,pt) importFrom(stats,qnorm) +importFrom(stats,qt) importFrom(stats,quantile) importFrom(stats,rnorm) importFrom(stats,sd) diff --git a/NEWS.md b/NEWS.md index 5c21e5b..dd517e0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,12 @@ +esci version 1.0.3 (Release data: July 2024) +=========== + +Changes: + +* Tweaks to deal with changes in statpsych 1.6. No substantive updates. + + + esci version 1.0.2 (Release data: March 2024) =========== diff --git a/R/esci-package.R b/R/esci-package.R index e6f8b97..61a6dfc 100644 --- a/R/esci-package.R +++ b/R/esci-package.R @@ -13,16 +13,12 @@ #' @importFrom statpsych ci.lc.mean.bs #' @importFrom statpsych ci.lc.median.bs #' @importFrom statpsych ci.lc.prop.bs -#' @importFrom statpsych ci.mean1 -#' @importFrom statpsych ci.median1 #' @importFrom statpsych ci.oddsratio #' @importFrom statpsych ci.phi -#' @importFrom statpsych ci.prop1 #' @importFrom statpsych ci.ratio.mean2 #' @importFrom statpsych ci.ratio.mean.ps #' @importFrom statpsych ci.ratio.median2 #' @importFrom statpsych ci.ratio.median.ps -#' @importFrom statpsych ci.stdmean1 #' @importFrom statpsych ci.stdmean.ps #' @importFrom stats aggregate #' @importFrom stats anova @@ -35,8 +31,10 @@ #' @importFrom stats qnorm #' @importFrom stats predict #' @importFrom stats pt +#' @importFrom stats pbinom #' @importFrom stats pnorm #' @importFrom stats qnorm +#' @importFrom stats qt #' @importFrom stats quantile #' @importFrom stats rnorm #' @importFrom stats sd diff --git a/R/estimate_magnitude.R b/R/estimate_magnitude.R index e59293b..5d829a9 100644 --- a/R/estimate_magnitude.R +++ b/R/estimate_magnitude.R @@ -16,9 +16,9 @@ #' If you want to compare your sample to a known value or reference, then #' use [esci::estimate_mdiff_one()]. #' -#' The estimated mean is from [statpsych::ci.mean1()]. +#' The estimated mean is from [statpsych::ci.mean()]. #' -#' The estimated median is from [statpsych::ci.median1()] +#' The estimated median is from [statpsych::ci.median()] #' #' #' @param data For raw data - A data frame or tibble @@ -466,7 +466,7 @@ estimate_magnitude.vector <- function( estimate$properties$data_source <- NULL # 2 alpha CI for median - mdn_2a <- statpsych::ci.median1( + mdn_2a <- wrapper_ci.median( alpha = (1 - conf_level)*2, y =outcome_variable[!is.na(outcome_variable)] ) diff --git a/R/estimate_mdiff_one.R b/R/estimate_mdiff_one.R index 09832f3..9375d63 100644 --- a/R/estimate_mdiff_one.R +++ b/R/estimate_mdiff_one.R @@ -16,11 +16,11 @@ #' it with [esci::plot_mdiff()] and you can test hypotheses with #' [esci::test_mdiff()]. #' -#' The estimated mean differences are from [statpsych::ci.mean1()]. +#' The estimated mean differences are from [statpsych::ci.mean()]. #' #' The estimated SMDs are from [esci::CI_smd_one()]. #' -#' The estimated median differences are from [statpsych::ci.median1()] +#' The estimated median differences are from [statpsych::ci.median()] #' #' #' @param data For raw data - a data frame or tibble diff --git a/R/estimate_pdiff_one.R b/R/estimate_pdiff_one.R index a376b49..46be2a8 100644 --- a/R/estimate_pdiff_one.R +++ b/R/estimate_pdiff_one.R @@ -15,7 +15,7 @@ #' it with [esci::plot_pdiff()] and you can test hypotheses with #' [esci::test_pdiff()]. #' -#' The estimated proportion differences are from [statpsych::ci.prop1()]. +#' The estimated proportion differences are from [statpsych::ci.prop()]. #' #' #' @param data For raw data - a dataframe or tibble diff --git a/R/estimate_proportion.R b/R/estimate_proportion.R index 5afedd4..e1b8bb2 100644 --- a/R/estimate_proportion.R +++ b/R/estimate_proportion.R @@ -14,7 +14,7 @@ #' If you want to compare your estimate to a known value or reference, then #' use [esci::estimate_pdiff_one()]. #' -#' The estimated proportions are from [statpsych::ci.prop1()]. +#' The estimated proportions are from [statpsych::ci.prop()]. #' #' #' @param data For raw data - a data frame or tibble diff --git a/R/overview.R b/R/overview.R index 06e198a..0c89595 100644 --- a/R/overview.R +++ b/R/overview.R @@ -10,8 +10,8 @@ #' #' @details #' If equal variance is not assumed, each group is treated independently. In -#' that case, the estimated mean, CI, and SE is from [statpsych::ci.mean1()], -#' and the estimated median, CI, and SE is from [statpsych::ci.median1()]. If +#' that case, the estimated mean, CI, and SE is from [statpsych::ci.mean()], +#' and the estimated median, CI, and SE is from [statpsych::ci.median()]. If #' equal variance is assumed, each group CI is calculated as with respect to all #' group data, using [statpsych::ci.lc.mean.bs()] and #' [statpsych::ci.lc.median.bs()] @@ -285,7 +285,7 @@ overview.base <- function( # Analysis ---------------------------------------- if (n_means == 1) { res <- as.data.frame( - statpsych::ci.mean1( + wrapper_ci.mean ( alpha = 1 - conf_level, m = overview_table$mean, sd = overview_table$sd, @@ -725,7 +725,7 @@ wrap_ci_median1 <- function( if(length(na.omit(x)) < 2) return(c(median(x), NA, NA, NA)) - res <- statpsych::ci.median1( + res <- wrapper_ci.median( alpha = 1 - conf_level, y = if(na.rm) x[!is.na(x)] else x ) @@ -743,7 +743,7 @@ wrap_ci_mean1 <- function( if(length(x) < 2) return(c(mean(x), NA, NA, NA)) - res <- statpsych::ci.mean1( + res <- wrapper_ci.mean( alpha = 1 - conf_level, m = mean(x, na.rm = na.rm), sd = sd(x, na.rm = na.rm), diff --git a/R/overview_nominal.R b/R/overview_nominal.R index 2c6d4e6..236c2a2 100644 --- a/R/overview_nominal.R +++ b/R/overview_nominal.R @@ -244,7 +244,7 @@ overview_nominal.base <- function( res_ta <- res } else { res <- as.data.frame( - statpsych::ci.prop1( + wrapper_ci.prop( alpha = 1 - conf_level, f = overview_table$cases[x], n = overview_table$n[x] @@ -252,7 +252,7 @@ overview_nominal.base <- function( ) res_ta <- as.data.frame( - statpsych::ci.prop1( + wrapper_ci.prop( alpha = (1 - conf_level)*2, f = overview_table$cases[x], n = overview_table$n[x] diff --git a/R/plot_aesthetics.R b/R/plot_aesthetics.R index 678ecb3..62b5e61 100644 --- a/R/plot_aesthetics.R +++ b/R/plot_aesthetics.R @@ -197,6 +197,11 @@ esci_plot_mdiff_aesthetics <- function( esci_plot_simple_aesthetics <- function(myplot, use_ggdist = TRUE) { # Customize plot ------------------------------- # No legend + + ggplot_version <- as.numeric(gsub("\\.", "", utils::packageVersion("ggplot2"))) + + + myplot <- myplot + ggplot2::theme(legend.position = "none") # Points @@ -214,24 +219,43 @@ esci_plot_simple_aesthetics <- function(myplot, use_ggdist = TRUE) { if (use_ggdist) { myplot <- myplot + ggplot2::discrete_scale( - c("size", "point_size"), - "point_size_d", - function(n) return(c("raw" = 1, "summary" = 3)) + aesthetics = c("size", "point_size"), + scale_name = if (ggplot_version >= 350) NULL else "point_size_d", + palette = function(n) return(c("raw" = 1, "summary" = 3)) ) } else { + + if (ggplot_version >= 350) { + myplot <- myplot + ggplot2::discrete_scale( + aesthetics = c("size"), + palette = function(n) return(c("raw" = 1, "summary" = 1)) + ) + + } else { + myplot <- myplot + ggplot2::discrete_scale( + aesthetics = c("size"), + scale_name = "point_size_d", + palette = function(n) return(c("raw" = 1, "summary" = 1)) + ) + + } + + } + + if (ggplot_version >= 350) { myplot <- myplot + ggplot2::discrete_scale( - c("size"), - "point_size_d", - function(n) return(c("raw" = 1, "summary" = 1)) + aesthetics = c("alpha", "point_alpha"), + palette = function(n) return(c("raw" = 0.8, "summary" = 1)) + ) + } else { + myplot <- myplot + ggplot2::discrete_scale( + c("alpha", "point_alpha"), + "point_alpha_d", + function(n) return(c("raw" = 0.8, "summary" = 1)) ) } - myplot <- myplot + ggplot2::discrete_scale( - c("alpha", "point_alpha"), - "point_alpha_d", - function(n) return(c("raw" = 0.8, "summary" = 1)) - ) # Error bars myplot <- myplot + ggplot2::scale_linetype_manual( @@ -241,16 +265,31 @@ esci_plot_simple_aesthetics <- function(myplot, use_ggdist = TRUE) { values = c("summary" = "black"), aesthetics = "interval_color" ) - myplot <- myplot + ggplot2::discrete_scale( - "interval_alpha", - "interval_alpha_d", - function(n) return(c("summary" = 1)) - ) - myplot <- myplot + ggplot2::discrete_scale( - "interval_size", - "interval_size_d", - function(n) return(c("summary" = 3)) - ) + + if (ggplot_version >= 350) { + myplot <- myplot + ggplot2::discrete_scale( + aesthetics = "interval_alpha", + palette = function(n) return(c("summary" = 1)) + ) + myplot <- myplot + ggplot2::discrete_scale( + aesthetics = "interval_size", + palette = function(n) return(c("summary" = 3)) + ) + + } else { + + myplot <- myplot + ggplot2::discrete_scale( + aesthetics = "interval_alpha", + scale_name = "interval_alpha_d", + palette = function(n) return(c("summary" = 1)) + ) + myplot <- myplot + ggplot2::discrete_scale( + aesthetics = "interval_size", + scale_name = "interval_size_d", + palette = function(n) return(c("summary" = 3)) + ) + + } # Slab @@ -258,11 +297,21 @@ esci_plot_simple_aesthetics <- function(myplot, use_ggdist = TRUE) { values = c("summary" = "gray"), aesthetics = "slab_fill" ) - myplot <- myplot + ggplot2::discrete_scale( - "slab_alpha", - "slab_alpha_d", - function(n) return(c("summary" = 1)) - ) + + if (ggplot_version >= 350) { + myplot <- myplot + ggplot2::discrete_scale( + aesthetics = "slab_alpha", + palette = function(n) return(c("summary" = 1)) + ) + + } else { + myplot <- myplot + ggplot2::discrete_scale( + aesthetics = "slab_alpha", + scale_name = "slab_alpha_d", + palette = function(n) return(c("summary" = 1)) + ) + + } return(myplot) } diff --git a/R/statpsych_apply.R b/R/statpsych_apply.R index 5057e9a..338f7ff 100644 --- a/R/statpsych_apply.R +++ b/R/statpsych_apply.R @@ -222,7 +222,7 @@ apply_ci_prop1 <- function( ) { res <- as.data.frame( - statpsych::ci.prop1( + wrapper_ci.prop( alpha = 1 - conf_level, f = myrow[["cases"]], n = myrow[["N"]] @@ -279,7 +279,7 @@ apply_ci_mean1 <- function( ) { res <- as.data.frame( - statpsych::ci.mean1( + wrapper_ci.mean( alpha = 1 - conf_level, m = myrow[["mean"]] - reference_mean, sd = myrow[["sd"]], diff --git a/R/statpsych_wrapper.R b/R/statpsych_wrapper.R index 45077d1..306e7fc 100644 --- a/R/statpsych_wrapper.R +++ b/R/statpsych_wrapper.R @@ -9,7 +9,7 @@ wrapper_ci.stdmean1 <- function( # Result from statpsych ------------------------------- res <- as.data.frame( - statpsych::ci.stdmean1( + stolen_ci.stdmean( alpha = 1 - conf_level, m = comparison_mean, sd = comparison_sd, @@ -405,7 +405,7 @@ wrapper_ci.median.ps <- function( ) { res <- as.data.frame( - statpsych::ci.median1( + wrapper_ci.median( alpha = 1 - conf_level, y = comparison_measure ) @@ -414,7 +414,7 @@ wrapper_ci.median.ps <- function( res <- rbind( res, as.data.frame( - statpsych::ci.median1( + wrapper_ci.median( alpha = 1 - conf_level, y = reference_measure ) @@ -628,3 +628,99 @@ wrapper_ci.cor2 <- function( return(res) } + + +wrapper_ci.mean <- function(alpha, m, sd, n) { + + # return(statpsych::ci.mean(alpha, m, sd, n)) + + df <- n - 1 + tcrit <- qt(1 - alpha/2, df) + se <- sd/sqrt(n) + ll <- m - tcrit*se + ul <- m + tcrit*se + out <- t(c(m, se, ll, ul)) + colnames(out) <- c("Estimate", "SE", "LL", "UL") + rownames(out) <- "" + return(out) + +} + +wrapper_ci.median <- function(alpha, y) { + # return(statpsych::ci.median(alpha, y)) + + n <- length(y) + y <- sort(y) + z <- qnorm(1 - alpha/2) + median <- median(y) + c1 <- round((n - z*sqrt(n))/2) + if (c1 < 1) {c1 = 1} + ll <- y[c1] + ul <- y[n - c1 + 1] + a <- round(n/2 - sqrt(n)) + if (a < 1) {a = 1} + ll1 <- y[a] + ul1 <- y[n - a + 1] + p <- pbinom(a - 1, size = n, prob = .5) + z0 <- qnorm(1 - p) + se <- (ul1 - ll1)/(2*z0) + out <- t(c(median, se, ll, ul)) + colnames(out) <- c("Estimate", "SE", "LL", "UL") + rownames(out) <- "" + return(out) + + +} + +wrapper_ci.prop <- function(alpha, f, n) { + + # return( + # statpsych::ci.prop( + # alpha = alpha, + # f = f, + # n = n + # ) + # ) + + if (f > n) {stop("f cannot be greater than n")} + z <- qnorm(1 - alpha/2) + p.mle <- f/n + se.mle <- sqrt(p.mle*(1 - p.mle)/n) + b1 <- 2*n*p.mle + z^2 + b2 <- 2*(n + z^2) + LL.wil <- (b1 - 1 - z*sqrt(z^2 - 2 - 1/n + 4*p.mle*(n*(1 - p.mle) + 1)))/b2 + UL.wil <- (b1 + 1 + z*sqrt(z^2 + 2 - 1/n + 4*p.mle*(n*(1 - p.mle) - 1)))/b2 + if (p.mle == 0) {LL.wil = 0} + if (p.mle == 1) {UL.wil = 1} + p.adj <- (f + 2)/(n + 4) + se.adj <- sqrt(p.adj*(1 - p.adj)/(n + 4)) + LL.adj <- p.adj - z*se.adj + UL.adj <- p.adj + z*se.adj + if (LL.adj < 0) {LL.adj = 0} + if (UL.adj > 1) {UL.adj = 1} + out1 <- t(c(p.adj, se.adj, LL.adj, UL.adj)) + out2 <- t(c(p.mle, se.mle, LL.wil, UL.wil)) + out <- rbind(out1, out2) + colnames(out) <- c("Estimate", "SE", "LL", "UL") + rownames(out) <- c("Adjusted Wald", "Wilson with cc") + return(out) + + +} + + +stolen_ci.stdmean <- function(alpha, m, sd, n, h) { + z <- qnorm(1 - alpha/2) + df <- n - 1 + adj <- 1 - 3/(4*df - 1) + est <- (m - h)/sd + estu <- adj*est + se <- sqrt(est^2/(2*df) + 1/df) + ll <- est - z*se + ul <- est + z*se + out <- t(c(est, estu, se, ll, ul)) + colnames(out) <- c("Estimate", "adj Estimate", "SE", "LL", "UL") + rownames(out) <- "" + return(out) +} + diff --git a/jamovi/jamovimetapdiff.a.yaml b/jamovi/jamovimetapdiff.a.yaml index 4dfc412..8408c2d 100644 --- a/jamovi/jamovimetapdiff.a.yaml +++ b/jamovi/jamovimetapdiff.a.yaml @@ -75,7 +75,7 @@ options: - name: RR title: 'Log risk ratio (ln(RR))' - name: OR - title: 'Log ddds ratio (ln(OR))' + title: 'Log odds ratio (ln(OR))' - name: AS title: "Arcsine-square-root-transformed risk difference (1/2 * Cohen's H)" - name: PETO diff --git a/man/estimate_magnitude.Rd b/man/estimate_magnitude.Rd index 5424ac8..af1f18b 100644 --- a/man/estimate_magnitude.Rd +++ b/man/estimate_magnitude.Rd @@ -109,9 +109,9 @@ it with \code{\link[=plot_magnitude]{plot_magnitude()}}. If you want to compare your sample to a known value or reference, then use \code{\link[=estimate_mdiff_one]{estimate_mdiff_one()}}. -The estimated mean is from \code{\link[statpsych:ci.mean1]{statpsych::ci.mean1()}}. +The estimated mean is from \code{\link[statpsych:ci.mean]{statpsych::ci.mean()}}. -The estimated median is from \code{\link[statpsych:ci.median1]{statpsych::ci.median1()}} +The estimated median is from \code{\link[statpsych:ci.median]{statpsych::ci.median()}} } \examples{ # From raw data diff --git a/man/estimate_mdiff_one.Rd b/man/estimate_mdiff_one.Rd index c7226eb..0dc64ef 100644 --- a/man/estimate_mdiff_one.Rd +++ b/man/estimate_mdiff_one.Rd @@ -149,11 +149,11 @@ Once you generate an estimate with this function, you can visualize it with \code{\link[=plot_mdiff]{plot_mdiff()}} and you can test hypotheses with \code{\link[=test_mdiff]{test_mdiff()}}. -The estimated mean differences are from \code{\link[statpsych:ci.mean1]{statpsych::ci.mean1()}}. +The estimated mean differences are from \code{\link[statpsych:ci.mean]{statpsych::ci.mean()}}. The estimated SMDs are from \code{\link[=CI_smd_one]{CI_smd_one()}}. -The estimated median differences are from \code{\link[statpsych:ci.median1]{statpsych::ci.median1()}} +The estimated median differences are from \code{\link[statpsych:ci.median]{statpsych::ci.median()}} } \examples{ # From raw data diff --git a/man/estimate_pdiff_one.Rd b/man/estimate_pdiff_one.Rd index 505cad4..f003054 100644 --- a/man/estimate_pdiff_one.Rd +++ b/man/estimate_pdiff_one.Rd @@ -90,7 +90,7 @@ Once you generate an estimate with this function, you can visualize it with \code{\link[=plot_pdiff]{plot_pdiff()}} and you can test hypotheses with \code{\link[=test_pdiff]{test_pdiff()}}. -The estimated proportion differences are from \code{\link[statpsych:ci.prop1]{statpsych::ci.prop1()}}. +The estimated proportion differences are from \code{\link[statpsych:ci.prop]{statpsych::ci.prop()}}. } \examples{ # From raw data diff --git a/man/estimate_proportion.Rd b/man/estimate_proportion.Rd index a26a8b3..61c1e0c 100644 --- a/man/estimate_proportion.Rd +++ b/man/estimate_proportion.Rd @@ -86,7 +86,7 @@ it with \code{\link[=plot_proportion]{plot_proportion()}}. If you want to compare your estimate to a known value or reference, then use \code{\link[=estimate_pdiff_one]{estimate_pdiff_one()}}. -The estimated proportions are from \code{\link[statpsych:ci.prop1]{statpsych::ci.prop1()}}. +The estimated proportions are from \code{\link[statpsych:ci.prop]{statpsych::ci.prop()}}. } \examples{ # From raw data diff --git a/man/overview.Rd b/man/overview.Rd index 7104d06..fbf9dd2 100644 --- a/man/overview.Rd +++ b/man/overview.Rd @@ -90,8 +90,8 @@ vectors, or a data frame. } \details{ If equal variance is not assumed, each group is treated independently. In -that case, the estimated mean, CI, and SE is from \code{\link[statpsych:ci.mean1]{statpsych::ci.mean1()}}, -and the estimated median, CI, and SE is from \code{\link[statpsych:ci.median1]{statpsych::ci.median1()}}. If +that case, the estimated mean, CI, and SE is from \code{\link[statpsych:ci.mean]{statpsych::ci.mean()}}, +and the estimated median, CI, and SE is from \code{\link[statpsych:ci.median]{statpsych::ci.median()}}. If equal variance is assumed, each group CI is calculated as with respect to all group data, using \code{\link[statpsych:ci.lc.mean.bs]{statpsych::ci.lc.mean.bs()}} and \code{\link[statpsych:ci.lc.median.bs]{statpsych::ci.lc.median.bs()}} diff --git a/tests/testthat/test_estimate_magnitude.R b/tests/testthat/test_estimate_magnitude.R index 4abdb88..2c638db 100644 --- a/tests/testthat/test_estimate_magnitude.R +++ b/tests/testthat/test_estimate_magnitude.R @@ -52,7 +52,10 @@ test_that("estimate_magnitude of pen group from ESCI_summary_two: summary data, }) -test_that("Compare estimate_magnitude to statpsych::ci.mean1 example", { +test_that("Compare estimate_magnitude to statpsych::ci.mean example", { + + statpsych_version <- as.numeric(gsub("\\.", "", utils::packageVersion("statpsych"))) + if (statpsych_version < 160) return() mymean <- 24.5 mysd <- 3.65 @@ -66,7 +69,7 @@ test_that("Compare estimate_magnitude to statpsych::ci.mean1 example", { mysp <- as.list( as.data.frame( - statpsych::ci.mean1(.05, mymean, mysd, myn) + statpsych::ci.mean(.05, mymean, mysd, myn) ) ) @@ -87,7 +90,11 @@ test_that("Compare estimate_magnitude to statpsych::ci.mean1 example", { -test_that("Compare estimate_magnitude to statpsych::ci.mean1 example", { +test_that("Compare estimate_magnitude to statpsych::ci.mean example", { + + statpsych_version <- as.numeric(gsub("\\.", "", utils::packageVersion("statpsych"))) + if (statpsych_version < 160) return() + mymean <- 24.5 mysd <- 3.65 @@ -104,7 +111,7 @@ test_that("Compare estimate_magnitude to statpsych::ci.mean1 example", { mysp <- as.list( as.data.frame( - statpsych::ci.mean1(1 - myconf_level, mymean, mysd, myn) + statpsych::ci.mean(1 - myconf_level, mymean, mysd, myn) ) ) @@ -126,7 +133,11 @@ test_that("Compare estimate_magnitude to statpsych::ci.mean1 example", { }) -test_that("Compare estimate_magnitude to statpsych::ci.median1 example", { +test_that("Compare estimate_magnitude to statpsych::ci.median example", { + + statpsych_version <- as.numeric(gsub("\\.", "", utils::packageVersion("statpsych"))) + if (statpsych_version < 160) return() + myconfs <- c(0.90, 0.95, 0.99) @@ -141,7 +152,7 @@ test_that("Compare estimate_magnitude to statpsych::ci.median1 example", { mysp <- as.list( as.data.frame( - statpsych::ci.median1(1 - myconf_level, y) + statpsych::ci.median(1 - myconf_level, y) ) ) diff --git a/tests/testthat/test_estimate_mdiff_one.R b/tests/testthat/test_estimate_mdiff_one.R index 14c2335..89ad635 100644 --- a/tests/testthat/test_estimate_mdiff_one.R +++ b/tests/testthat/test_estimate_mdiff_one.R @@ -64,7 +64,10 @@ test_that("Compare estimate_mdiff_one to ESCI_summary_two, pen group", { -test_that("Compare estimate_mdiff_one to statpsych::ci.mean1 example", { +test_that("Compare estimate_mdiff_one to statpsych::ci.mean example", { + statpsych_version <- as.numeric(gsub("\\.", "", utils::packageVersion("statpsych"))) + if (statpsych_version < 160) return() + mymean <- 24.5 mysd <- 3.65 @@ -84,7 +87,7 @@ test_that("Compare estimate_mdiff_one to statpsych::ci.mean1 example", { mysp <- as.list( as.data.frame( - statpsych::ci.mean1(1 - myconf_level, mymean, mysd, myn) + statpsych::ci.mean(1 - myconf_level, mymean, mysd, myn) ) ) @@ -113,7 +116,11 @@ test_that("Compare estimate_mdiff_one to statpsych::ci.mean1 example", { }) -test_that("Compare estimate_mdiff_one to statpsych::ci.median1 example", { +test_that("Compare estimate_mdiff_one to statpsych::ci.median example", { + + statpsych_version <- as.numeric(gsub("\\.", "", utils::packageVersion("statpsych"))) + if (statpsych_version < 160) return() + myconfs <- c(0.90, 0.95, 0.99) myreference_means <- c(0, -10, 10) @@ -131,7 +138,7 @@ test_that("Compare estimate_mdiff_one to statpsych::ci.median1 example", { mysp <- as.list( as.data.frame( - statpsych::ci.median1(1 - myconf_level, y) + statpsych::ci.median(1 - myconf_level, y) ) ) diff --git a/tests/testthat/test_estimate_pdiff_one.R b/tests/testthat/test_estimate_pdiff_one.R index 50ed666..88f1704 100644 --- a/tests/testthat/test_estimate_pdiff_one.R +++ b/tests/testthat/test_estimate_pdiff_one.R @@ -1,4 +1,7 @@ test_that("Compare estimate_pdiff_one to ESCI_One_Proportion example", { + statpsych_version <- as.numeric(gsub("\\.", "", utils::packageVersion("statpsych"))) + if (statpsych_version < 160) return() + # Esci one proportion - 8/22 estimate <- estimate_pdiff_one( @@ -12,7 +15,7 @@ test_that("Compare estimate_pdiff_one to ESCI_One_Proportion example", { mysp <- as.list( as.data.frame( - statpsych::ci.prop1(.05, 8, 22) + statpsych::ci.prop(.05, 8, 22) )[1, ] ) @@ -62,7 +65,7 @@ test_that("Call estimate_pdiff_one with vector", { mysp <- as.list( as.data.frame( - statpsych::ci.prop1(1 - myconf_level, 8, 22) + statpsych::ci.prop(1 - myconf_level, 8, 22) )[1, ] ) @@ -84,6 +87,10 @@ test_that("Call estimate_pdiff_one with vector", { test_that("Call estimate_proportion with dataframe", { + statpsych_version <- as.numeric(gsub("\\.", "", utils::packageVersion("statpsych"))) + if (statpsych_version < 160) return() + + dep_status <- as.factor( c( @@ -114,7 +121,7 @@ test_that("Call estimate_proportion with dataframe", { mysp <- as.list( as.data.frame( - statpsych::ci.prop1(1 - myconf_level, 8, 22) + statpsych::ci.prop(1 - myconf_level, 8, 22) )[1, ] ) diff --git a/tests/testthat/test_estimate_proportion.R b/tests/testthat/test_estimate_proportion.R index a4d4c3c..c41ed1a 100644 --- a/tests/testthat/test_estimate_proportion.R +++ b/tests/testthat/test_estimate_proportion.R @@ -1,4 +1,7 @@ test_that("Compare estimate_proportion to ESCI_One_Proportion example", { + statpsych_version <- as.numeric(gsub("\\.", "", utils::packageVersion("statpsych"))) + if (statpsych_version < 160) return() + estimate <- esci::estimate_proportion( cases = c(8, 22-8), @@ -9,7 +12,7 @@ test_that("Compare estimate_proportion to ESCI_One_Proportion example", { mysp <- as.list( as.data.frame( - statpsych::ci.prop1(.05, 8, 22) + statpsych::ci.prop(.05, 8, 22) )[1, ] ) @@ -28,6 +31,9 @@ test_that("Compare estimate_proportion to ESCI_One_Proportion example", { test_that("Call estimate_proportion with vector", { + statpsych_version <- as.numeric(gsub("\\.", "", utils::packageVersion("statpsych"))) + if (statpsych_version < 160) return() + dep_status <- as.factor( c( @@ -52,7 +58,7 @@ test_that("Call estimate_proportion with vector", { mysp <- as.list( as.data.frame( - statpsych::ci.prop1(1 - myconf_level, 8, 22) + statpsych::ci.prop(1 - myconf_level, 8, 22) )[1, ] ) @@ -104,7 +110,7 @@ test_that("Call estimate_proportion with dataframe", { mysp <- as.list( as.data.frame( - statpsych::ci.prop1(1 - myconf_level, 8, 22) + statpsych::ci.prop(1 - myconf_level, 8, 22) )[1, ] ) From 518c99606ec4244990732659bf1f89bcbaa6b89d Mon Sep 17 00:00:00 2001 From: Calin-Jageman Date: Mon, 8 Jul 2024 14:22:58 -0500 Subject: [PATCH 2/3] tweaks towards 1.0.3 updated docs site, updated ci_smd_ind_contrast with math support, tweaks to work with statpsych 1.5 and 1.6 --- DESCRIPTION | 2 +- NEWS.md | 2 +- R/CI_smd_ind_contrast.R | 14 +- R/estimate_magnitude.R | 6 +- R/estimate_mdiff_one.R | 6 +- R/estimate_pdiff_one.R | 3 +- R/estimate_proportion.R | 3 +- R/overview.R | 4 +- README.md | 4 +- _pkgdown.yml | 1 + docs/404.html | 61 +- docs/authors.html | 63 +- docs/deps/KaTex-0.16.10/katex.min.css | 1 + docs/deps/KaTex-0.16.10/katex.min.js | 1 + docs/deps/MathJax-3.2.2/tex-chtml.min.js | 3 + docs/deps/bootstrap-5.3.1/bootstrap.min.css | 4 +- docs/deps/bootstrap-5.3.1/font.css | 124 - ...txg8zYS_SKggPN4iEgvnHyvveLxVs9pbCIPrc.woff | Bin 27828 -> 0 bytes ...txg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrc.woff | Bin 27492 -> 0 bytes .../1adeadb2fe618c5ed46221f15e12b9c8.woff | Bin 46088 -> 0 bytes .../fonts/4iCs6KVjbNBYlgo6ew.woff | Bin 134032 -> 0 bytes .../fonts/4iCs6KVjbNBYlgoKfw7w.woff | Bin 39832 -> 0 bytes .../fonts/4iCv6KVjbNBYlgoCxCvTtA.woff | Bin 117140 -> 0 bytes .../fonts/4iCv6KVjbNBYlgoCxCvjsGyL.woff | Bin 34452 -> 0 bytes .../6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDQ.woff | Bin 17760 -> 0 bytes .../6xK1dSBYKcSV-LCoeQqfX1RYOo3qPa7j.woff | Bin 49156 -> 0 bytes .../fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3aPA.woff | Bin 74684 -> 0 bytes .../6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7j.woff | Bin 18420 -> 0 bytes .../6xKydSBYKcSV-LCoeQqfX1RYOo3i54rAkw.woff | Bin 74348 -> 0 bytes .../6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vAkw.woff | Bin 74332 -> 0 bytes .../6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdo.woff | Bin 18388 -> 0 bytes .../6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zAkw.woff | Bin 74148 -> 0 bytes .../6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdo.woff | Bin 18340 -> 0 bytes .../fonts/CSR54z1Qlv-GDxkbKVQ_dFsvWNRevw.woff | Bin 16724 -> 0 bytes .../fonts/CSR54z1Qlv-GDxkbKVQ_dFsvaNA.woff | Bin 29672 -> 0 bytes .../fonts/CSR64z1Qlv-GDxkbKVQ_TOQ.woff | Bin 75128 -> 0 bytes .../fonts/CSR64z1Qlv-GDxkbKVQ_fOAKSw.woff | Bin 16516 -> 0 bytes ...xRpg3hIP6sJ7fM7PqPMcMnZFqUwX28DBKXhM0.woff | Bin 55992 -> 0 bytes ...xRpg3hIP6sJ7fM7PqPMcMnZFqUwX28DMyQhM0.woff | Bin 56004 -> 0 bytes ...g3hIP6sJ7fM7PqlOPHYvDP_W9O7GQTTbI1rSg.woff | Bin 47720 -> 0 bytes ...g3hIP6sJ7fM7PqlOPHYvDP_W9O7GQTTsoprSg.woff | Bin 47924 -> 0 bytes ...HjIg1_i6t8kCHKm4532VJOt5-QNFgpCtZ6Ew9.woff | Bin 50580 -> 0 bytes ...HjIg1_i6t8kCHKm4532VJOt5-QNFgpCtr6Ew9.woff | Bin 50580 -> 0 bytes ...HjIg1_i6t8kCHKm4532VJOt5-QNFgpCuM70w9.woff | Bin 51108 -> 0 bytes .../fonts/KFOlCnqEu92Fr1MmEU9fBBc-.woff | Bin 20544 -> 0 bytes .../fonts/KFOlCnqEu92Fr1MmEU9vAA.woff | Bin 65756 -> 0 bytes .../fonts/KFOlCnqEu92Fr1MmSU5fBBc-.woff | Bin 20416 -> 0 bytes .../fonts/KFOlCnqEu92Fr1MmSU5vAA.woff | Bin 65164 -> 0 bytes .../fonts/KFOlCnqEu92Fr1MmWUlfBBc-.woff | Bin 20408 -> 0 bytes .../fonts/KFOlCnqEu92Fr1MmWUlvAA.woff | Bin 65556 -> 0 bytes .../fonts/KFOmCnqEu92Fr1Me5g.woff | Bin 65456 -> 0 bytes .../fonts/KFOmCnqEu92Fr1Mu4mxM.woff | Bin 20344 -> 0 bytes .../fonts/QGYpz_kZZAGCONcK2A4bGOj8mNhL.woff | Bin 89776 -> 0 bytes .../fonts/S6u8w4BMUTPHjxsAXC-s.woff | Bin 29864 -> 0 bytes .../fonts/S6u8w4BMUTPHjxswWA.woff | Bin 35436 -> 0 bytes .../fonts/S6u9w4BMUTPHh6UVSwiPHw.woff | Bin 28044 -> 0 bytes .../fonts/S6u9w4BMUTPHh6UVeww.woff | Bin 33296 -> 0 bytes .../fonts/S6u9w4BMUTPHh7USSwiPHw.woff | Bin 30016 -> 0 bytes .../fonts/S6u9w4BMUTPHh7USeww.woff | Bin 35168 -> 0 bytes .../fonts/S6uyw4BMUTPHjx4wWA.woff | Bin 28648 -> 0 bytes .../fonts/S6uyw4BMUTPHvxo.woff | Bin 34020 -> 0 bytes ...HuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYMZs.woff | Bin 138900 -> 0 bytes ...HuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fMZs.woff | Bin 137508 -> 0 bytes ...HuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZs.woff | Bin 128192 -> 0 bytes .../XRXI3I6Li01BKofiOc5wtlZ2di8HDFwmRTA.woff | Bin 53216 -> 0 bytes .../XRXI3I6Li01BKofiOc5wtlZ2di8HDGUmRTA.woff | Bin 54196 -> 0 bytes .../XRXI3I6Li01BKofiOc5wtlZ2di8HDLshRTA.woff | Bin 53856 -> 0 bytes .../a98f7a7574819ba83bec6279a2cecd95.woff | Bin 45884 -> 0 bytes ...cVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk0ZjaVQ.woff | Bin 72136 -> 0 bytes ...SCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVAexg.woff | Bin 23636 -> 0 bytes ...cVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkaVQ.woff | Bin 74700 -> 0 bytes ...SCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVAexg.woff | Bin 23576 -> 0 bytes ...cVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkaVQ.woff | Bin 74564 -> 0 bytes ...cVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk_RkaVQ.woff | Bin 74940 -> 0 bytes ...cVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkxhjaVQ.woff | Bin 74644 -> 0 bytes ...SCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjWVAexg.woff | Bin 22964 -> 0 bytes ...cVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjaVQ.woff | Bin 71660 -> 0 bytes ...X2vVnXBbObj2OVZyOOSr4dVJWUgsg-1x4gaVQ.woff | Bin 22332 -> 0 bytes ...vWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1y4k.woff | Bin 68664 -> 0 bytes ...vWbX2vVnXBbObj2OVZyOOSr4dVJWUgsgH1y4k.woff | Bin 70652 -> 0 bytes ...vWbX2vVnXBbObj2OVZyOOSr4dVJWUgshZ1y4k.woff | Bin 69392 -> 0 bytes ...X2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4gaVQ.woff | Bin 22940 -> 0 bytes ...vWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0C4k.woff | Bin 70524 -> 0 bytes ...X2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4gaVQ.woff | Bin 22908 -> 0 bytes ...vWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0C4k.woff | Bin 70792 -> 0 bytes ...vWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjr0C4k.woff | Bin 71144 -> 0 bytes .../fonts/q5uGsou0JOdh94bfvQlr.woff | Bin 31584 -> 0 bytes .../bootstrap-toc-1.0.1/bootstrap-toc.min.js | 5 + .../deps/clipboard.js-2.0.11/clipboard.min.js | 7 + docs/deps/data-deps.txt | 10 + docs/deps/font-awesome-6.4.2/css/all.css | 7968 +++++++++++++++++ docs/deps/font-awesome-6.4.2/css/all.min.css | 9 + docs/deps/font-awesome-6.4.2/css/v4-shims.css | 2194 +++++ .../font-awesome-6.4.2/css/v4-shims.min.css | 6 + .../webfonts/fa-brands-400.ttf | Bin 0 -> 189684 bytes .../webfonts/fa-brands-400.woff2 | Bin 0 -> 109808 bytes .../webfonts/fa-regular-400.ttf | Bin 0 -> 63348 bytes .../webfonts/fa-regular-400.woff2 | Bin 0 -> 24488 bytes .../webfonts/fa-solid-900.ttf | Bin 0 -> 394668 bytes .../webfonts/fa-solid-900.woff2 | Bin 0 -> 150020 bytes .../webfonts/fa-v4compatibility.ttf | Bin 0 -> 10172 bytes .../webfonts/fa-v4compatibility.woff2 | Bin 0 -> 4568 bytes docs/deps/headroom-0.11.0/headroom.min.js | 7 + .../headroom-0.11.0/jQuery.headroom.min.js | 7 + .../search-1.0.0/autocomplete.jquery.min.js | 7 + docs/deps/search-1.0.0/fuse.min.js | 9 + docs/deps/search-1.0.0/mark.min.js | 7 + docs/index.html | 63 +- docs/katex-auto.js | 14 + docs/lightswitch.js | 85 + docs/news/index.html | 58 +- docs/pkgdown.js | 10 +- docs/pkgdown.yml | 7 +- docs/reference/CI_diamond_ratio.html | 71 +- docs/reference/CI_smd_ind_contrast.html | 101 +- docs/reference/CI_smd_one.html | 68 +- docs/reference/data_altruism_happiness.html | 56 +- docs/reference/data_anchor_estimate_ma.html | 56 +- docs/reference/data_basol_badnews.html | 56 +- docs/reference/data_bem_psychic.html | 56 +- docs/reference/data_bodywellf.html | 56 +- docs/reference/data_bodywellfm.html | 56 +- docs/reference/data_bodywellm.html | 56 +- docs/reference/data_campus_involvement.html | 56 +- .../reference/data_chap_8_paired_ex_8.18.html | 62 +- docs/reference/data_clean_moral.html | 56 +- docs/reference/data_college_survey_1.html | 56 +- docs/reference/data_college_survey_2.html | 52 +- docs/reference/data_damischrcj.html | 52 +- docs/reference/data_effronraj_fakenews.html | 56 +- docs/reference/data_emotion_heartrate.html | 56 +- docs/reference/data_exam_scores.html | 56 +- docs/reference/data_flag_priming_ma.html | 56 +- docs/reference/data_gender_math_iat.html | 56 +- docs/reference/data_gender_math_iat_ma.html | 56 +- docs/reference/data_halagappa.html | 56 +- docs/reference/data_home_prices.html | 56 +- docs/reference/data_kardas_expt_3.html | 56 +- docs/reference/data_kardas_expt_4.html | 56 +- docs/reference/data_labels_flavor.html | 56 +- docs/reference/data_latimier_3groups.html | 56 +- docs/reference/data_latimier_prequiz.html | 56 +- docs/reference/data_latimier_quiz.html | 56 +- .../reference/data_latimier_quiz_prequiz.html | 56 +- docs/reference/data_latimier_reread.html | 56 +- .../data_latimier_reread_prequiz.html | 56 +- docs/reference/data_latimier_reread_quiz.html | 56 +- docs/reference/data_macnamara_r_ma.html | 56 +- docs/reference/data_mccabemichael_brain.html | 56 +- docs/reference/data_mccabemichael_brain2.html | 56 +- docs/reference/data_meditationbrain.html | 56 +- docs/reference/data_organicmoral.html | 56 +- docs/reference/data_penlaptop1.html | 52 +- docs/reference/data_powerperformance_ma.html | 56 +- docs/reference/data_rattanmotivation.html | 56 +- docs/reference/data_religionsharing.html | 56 +- docs/reference/data_religious_belief.html | 56 +- docs/reference/data_selfexplain.html | 56 +- docs/reference/data_simmonscredibility.html | 56 +- docs/reference/data_sleep_beauty.html | 56 +- docs/reference/data_smithrecall.html | 52 +- docs/reference/data_stickgold.html | 56 +- docs/reference/data_studystrategies.html | 56 +- docs/reference/data_thomason_1.html | 56 +- docs/reference/data_videogameaggression.html | 56 +- .../esci_plot_difference_axis_x.html | 66 +- docs/reference/estimate_magnitude.html | 82 +- .../reference/estimate_mdiff_2x2_between.html | 93 +- docs/reference/estimate_mdiff_2x2_mixed.html | 79 +- .../estimate_mdiff_ind_contrast.html | 89 +- docs/reference/estimate_mdiff_one.html | 87 +- docs/reference/estimate_mdiff_paired.html | 89 +- docs/reference/estimate_mdiff_two.html | 92 +- .../estimate_pdiff_ind_contrast.html | 87 +- docs/reference/estimate_pdiff_one.html | 84 +- docs/reference/estimate_pdiff_paired.html | 89 +- docs/reference/estimate_pdiff_two.html | 88 +- docs/reference/estimate_proportion.html | 79 +- docs/reference/estimate_r.html | 129 +- docs/reference/estimate_rdiff_two.html | 91 +- docs/reference/geom_meta_diamond_h.html | 100 +- docs/reference/index.html | 815 +- docs/reference/jamovicorrelation.html | 247 +- docs/reference/jamovidescribe.html | 119 +- docs/reference/jamovimagnitude.html | 159 +- docs/reference/jamovimdiff2x2.html | 303 +- docs/reference/jamovimdiffindcontrast.html | 263 +- docs/reference/jamovimdiffpaired.html | 247 +- docs/reference/jamovimdifftwo.html | 241 +- docs/reference/jamovimetamdiff.html | 235 +- docs/reference/jamovimetamean.html | 223 +- docs/reference/jamovimetapdiff.html | 213 +- docs/reference/jamovimetaproportion.html | 207 +- docs/reference/jamovimetar.html | 207 +- docs/reference/jamovipdiffpaired.html | 165 +- docs/reference/jamovipdifftwo.html | 179 +- docs/reference/jamoviproportion.html | 133 +- docs/reference/jamovirdifftwo.html | 243 +- docs/reference/meta_any.html | 82 +- docs/reference/meta_d1.html | 78 +- docs/reference/meta_d2.html | 87 +- docs/reference/meta_mdiff_two.html | 92 +- docs/reference/meta_mean.html | 84 +- docs/reference/meta_pdiff_two.html | 87 +- docs/reference/meta_proportion.html | 81 +- docs/reference/meta_r.html | 81 +- docs/reference/overview.html | 82 +- docs/reference/overview_nominal.html | 80 +- docs/reference/plot_correlation.html | 120 +- docs/reference/plot_describe.html | 96 +- docs/reference/plot_interaction.html | 72 +- docs/reference/plot_magnitude.html | 80 +- docs/reference/plot_mdiff.html | 94 +- docs/reference/plot_meta.html | 74 +- docs/reference/plot_pdiff.html | 82 +- docs/reference/plot_proportion.html | 74 +- docs/reference/plot_rdiff.html | 80 +- docs/reference/plot_scatter.html | 128 +- docs/reference/print.esci_estimate.html | 60 +- docs/reference/test_correlation.html | 66 +- docs/reference/test_mdiff.html | 70 +- docs/reference/test_pdiff.html | 66 +- docs/reference/test_rdiff.html | 66 +- docs/search.json | 2 +- docs/sitemap.xml | 496 +- jamovi/0000.yaml | 5 +- man/CI_smd_ind_contrast.Rd | 14 +- man/estimate_magnitude.Rd | 6 +- man/estimate_mdiff_one.Rd | 6 +- man/estimate_pdiff_one.Rd | 3 +- man/estimate_proportion.Rd | 3 +- man/geom_meta_diamond_h.Rd | 34 +- man/overview.Rd | 4 +- tests/testthat/test_estimate_magnitude.R | 63 +- tests/testthat/test_estimate_mdiff_one.R | 41 +- tests/testthat/test_estimate_pdiff_one.R | 71 +- tests/testthat/test_estimate_proportion.R | 67 +- 237 files changed, 15540 insertions(+), 6709 deletions(-) create mode 100644 docs/deps/KaTex-0.16.10/katex.min.css create mode 100644 docs/deps/KaTex-0.16.10/katex.min.js create mode 100644 docs/deps/MathJax-3.2.2/tex-chtml.min.js delete mode 100644 docs/deps/bootstrap-5.3.1/font.css delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVs9pbCIPrc.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrc.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/1adeadb2fe618c5ed46221f15e12b9c8.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/4iCs6KVjbNBYlgo6ew.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/4iCs6KVjbNBYlgoKfw7w.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/4iCv6KVjbNBYlgoCxCvTtA.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/4iCv6KVjbNBYlgoCxCvjsGyL.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDQ.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPa7j.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3aPA.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7j.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rAkw.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vAkw.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdo.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zAkw.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdo.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/CSR54z1Qlv-GDxkbKVQ_dFsvWNRevw.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/CSR54z1Qlv-GDxkbKVQ_dFsvaNA.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/CSR64z1Qlv-GDxkbKVQ_TOQ.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/CSR64z1Qlv-GDxkbKVQ_fOAKSw.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/HI_diYsKILxRpg3hIP6sJ7fM7PqPMcMnZFqUwX28DBKXhM0.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/HI_diYsKILxRpg3hIP6sJ7fM7PqPMcMnZFqUwX28DMyQhM0.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/HI_jiYsKILxRpg3hIP6sJ7fM7PqlOPHYvDP_W9O7GQTTbI1rSg.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/HI_jiYsKILxRpg3hIP6sJ7fM7PqlOPHYvDP_W9O7GQTTsoprSg.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCtZ6Ew9.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCtr6Ew9.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCuM70w9.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmEU9fBBc-.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmEU9vAA.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmSU5fBBc-.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmSU5vAA.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmWUlfBBc-.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmWUlvAA.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/KFOmCnqEu92Fr1Me5g.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/KFOmCnqEu92Fr1Mu4mxM.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/QGYpz_kZZAGCONcK2A4bGOj8mNhL.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/S6u8w4BMUTPHjxsAXC-s.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/S6u8w4BMUTPHjxswWA.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/S6u9w4BMUTPHh6UVSwiPHw.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/S6u9w4BMUTPHh6UVeww.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/S6u9w4BMUTPHh7USSwiPHw.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/S6u9w4BMUTPHh7USeww.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/S6uyw4BMUTPHjx4wWA.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/S6uyw4BMUTPHvxo.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYMZs.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fMZs.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZs.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/XRXI3I6Li01BKofiOc5wtlZ2di8HDFwmRTA.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/XRXI3I6Li01BKofiOc5wtlZ2di8HDGUmRTA.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/XRXI3I6Li01BKofiOc5wtlZ2di8HDLshRTA.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/a98f7a7574819ba83bec6279a2cecd95.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk0ZjaVQ.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVAexg.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkaVQ.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVAexg.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkaVQ.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk_RkaVQ.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkxhjaVQ.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjWVAexg.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjaVQ.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1x4gaVQ.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1y4k.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsgH1y4k.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgshZ1y4k.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4gaVQ.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0C4k.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4gaVQ.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0C4k.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjr0C4k.woff delete mode 100644 docs/deps/bootstrap-5.3.1/fonts/q5uGsou0JOdh94bfvQlr.woff create mode 100644 docs/deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js create mode 100644 docs/deps/clipboard.js-2.0.11/clipboard.min.js create mode 100644 docs/deps/font-awesome-6.4.2/css/all.css create mode 100644 docs/deps/font-awesome-6.4.2/css/all.min.css create mode 100644 docs/deps/font-awesome-6.4.2/css/v4-shims.css create mode 100644 docs/deps/font-awesome-6.4.2/css/v4-shims.min.css create mode 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.ttf create mode 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.woff2 create mode 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.ttf create mode 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.woff2 create mode 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.ttf create mode 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.woff2 create mode 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.ttf create mode 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.woff2 create mode 100644 docs/deps/headroom-0.11.0/headroom.min.js create mode 100644 docs/deps/headroom-0.11.0/jQuery.headroom.min.js create mode 100644 docs/deps/search-1.0.0/autocomplete.jquery.min.js create mode 100644 docs/deps/search-1.0.0/fuse.min.js create mode 100644 docs/deps/search-1.0.0/mark.min.js create mode 100644 docs/katex-auto.js create mode 100644 docs/lightswitch.js diff --git a/DESCRIPTION b/DESCRIPTION index ae8e5a0..34ab503 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -28,7 +28,7 @@ Imports: Rdpack, stringr, mathjaxr -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Roxygen: list(markdown = TRUE) RdMacros: Rdpack, mathjaxr Suggests: diff --git a/NEWS.md b/NEWS.md index dd517e0..bb67c91 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,7 +3,7 @@ esci version 1.0.3 (Release data: July 2024) Changes: -* Tweaks to deal with changes in statpsych 1.6. No substantive updates. +* Tweaks to deal with changes in statpsych 1.6. No substantive updates. diff --git a/R/CI_smd_ind_contrast.R b/R/CI_smd_ind_contrast.R index 6520f05..cf5eac0 100644 --- a/R/CI_smd_ind_contrast.R +++ b/R/CI_smd_ind_contrast.R @@ -2,11 +2,11 @@ #' contrast #' #' -#' @description `CI_smd_ind_contrast` returns the point estimate +#' @description \loadmathjax `CI_smd_ind_contrast` returns the point estimate #' and confidence interval for a standardized mean difference (smd aka Cohen's #' *d* aka Hedges *g*). A standardized mean difference is a difference in means standardized #' to a standard deviation: -#' d = psi/s +#' \mjdeqn{d = \frac{ \psi }{s}}{d = psi/s} #' #' #' @param means A vector of 2 or more means @@ -88,16 +88,16 @@ #' When equal variance is assumed, the standardized mean difference is #' d_s, defined in Kline, p. 196: #' -#' d_s = psi / sd_s +#' \mjdeqn{ d_s = \frac{ \psi }{ sd_{pooled} } }{ d_s = psi / sd_s} #' #' #' where psi is defined in Kline, equation 7.8: #' -#' psi = sum(contrasts*means) +#' \mjdeqn{ \psi =\sum_{i=1}^{a}c_iM_i }{psi = sum(contrasts*means)} #' #' #' and where sd_pooled is defined in Kline, equation 3.11 -#' sqrt(sum(variances*dfs) / sum(dfs)) +#' \mjdeqn{sd_{pooled} = { \frac{ \sum_{i=1}^{a} (n_i -1) s_i^2 } { \sum_{i=1}^{a} (n_i-1) } }}{sqrt(sum(variances*dfs) / sum(dfs))} #' #' #' The CI for d_s is derived from lambda-prime transformation from Lecoutre, @@ -115,12 +115,12 @@ #' assumed, the standardized mean difference is d_avg, defined in Bonett, #' equation 6: #' -#' d_avg = psi / sd_avg +#' \mjdeqn{ d_{avg} = \frac{ \psi }{ sd_{avg} }}{ d_avg = psi / sd_avg} #' #' Where sd_avg is the square root of the average of the group variances, as #' given in Bonett, explanation of equation 6: #' -#' sqrt(mean(variances)) +#' \mjdeqn{sd_{avg} = \sqrt{ \frac{ \sum_{i=1}^{a} s_i^2 }{ a } }}{sqrt(mean(variances))} #' #' #' #### If only 2 groups #### diff --git a/R/estimate_magnitude.R b/R/estimate_magnitude.R index 5d829a9..d8daf4d 100644 --- a/R/estimate_magnitude.R +++ b/R/estimate_magnitude.R @@ -16,9 +16,11 @@ #' If you want to compare your sample to a known value or reference, then #' use [esci::estimate_mdiff_one()]. #' -#' The estimated mean is from [statpsych::ci.mean()]. +#' The estimated mean is from [statpsych::ci.mean1()] (renamed ci.mean as of +#' statpsych 1.6). #' -#' The estimated median is from [statpsych::ci.median()] +#' The estimated median is from [statpsych::ci.median1()] (renamed ci.median +#' as of statpsych 1.6) #' #' #' @param data For raw data - A data frame or tibble diff --git a/R/estimate_mdiff_one.R b/R/estimate_mdiff_one.R index 9375d63..96cc486 100644 --- a/R/estimate_mdiff_one.R +++ b/R/estimate_mdiff_one.R @@ -16,11 +16,13 @@ #' it with [esci::plot_mdiff()] and you can test hypotheses with #' [esci::test_mdiff()]. #' -#' The estimated mean differences are from [statpsych::ci.mean()]. +#' The estimated mean differences are from [statpsych::ci.mean1()] (renamed +#' ci.mean as of statpsych 1.6). #' #' The estimated SMDs are from [esci::CI_smd_one()]. #' -#' The estimated median differences are from [statpsych::ci.median()] +#' The estimated median differences are from [statpsych::ci.median1()] (renamed +#' ci.median as of statpsych 1.6) #' #' #' @param data For raw data - a data frame or tibble diff --git a/R/estimate_pdiff_one.R b/R/estimate_pdiff_one.R index 46be2a8..30b2026 100644 --- a/R/estimate_pdiff_one.R +++ b/R/estimate_pdiff_one.R @@ -15,7 +15,8 @@ #' it with [esci::plot_pdiff()] and you can test hypotheses with #' [esci::test_pdiff()]. #' -#' The estimated proportion differences are from [statpsych::ci.prop()]. +#' The estimated proportion differences are from [statpsych::ci.prop1()] (renamed +#' ci.prop as of statpsych 1.6). #' #' #' @param data For raw data - a dataframe or tibble diff --git a/R/estimate_proportion.R b/R/estimate_proportion.R index e1b8bb2..dab176a 100644 --- a/R/estimate_proportion.R +++ b/R/estimate_proportion.R @@ -14,7 +14,8 @@ #' If you want to compare your estimate to a known value or reference, then #' use [esci::estimate_pdiff_one()]. #' -#' The estimated proportions are from [statpsych::ci.prop()]. +#' The estimated proportions are from [statpsych::ci.prop1()] (renamed +#' ci.prop as of statpsych 1.6). #' #' #' @param data For raw data - a data frame or tibble diff --git a/R/overview.R b/R/overview.R index 0c89595..789d75e 100644 --- a/R/overview.R +++ b/R/overview.R @@ -10,8 +10,8 @@ #' #' @details #' If equal variance is not assumed, each group is treated independently. In -#' that case, the estimated mean, CI, and SE is from [statpsych::ci.mean()], -#' and the estimated median, CI, and SE is from [statpsych::ci.median()]. If +#' that case, the estimated mean, CI, and SE is from [statpsych::ci.mean1()], +#' and the estimated median, CI, and SE is from [statpsych::ci.median1()]. If #' equal variance is assumed, each group CI is calculated as with respect to all #' group data, using [statpsych::ci.lc.mean.bs()] and #' [statpsych::ci.lc.median.bs()] diff --git a/README.md b/README.md index 17b8d3f..dea126b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# esci +# esci esci logo esci provides student-friendly tools for estimation statistics: @@ -90,4 +90,4 @@ plot_mdiff(estimate) ``` - +Example difference plot diff --git a/_pkgdown.yml b/_pkgdown.yml index 8829b59..c78dbdd 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -2,6 +2,7 @@ url: https://rcalinjageman.github.io/esci template: bootstrap: 5 + math-rendering: mathjax development: mode: auto diff --git a/docs/404.html b/docs/404.html index 949ad5a..bf59d05 100644 --- a/docs/404.html +++ b/docs/404.html @@ -8,59 +8,46 @@ Page not found (404) • esci - - - - + + + Skip to contents - -