From 0f43a929c78b806cd7fb89fb8dc914738a73177e Mon Sep 17 00:00:00 2001 From: JTPetter <61797391+JTPetter@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:51:32 +0100 Subject: [PATCH 1/3] Missing packages added to DESCRIPTION --- DESCRIPTION | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 447a684..6f2b8ee 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,7 +18,9 @@ Imports: jaspTTests, ggforce, tidyr, - igraph + igraph, + HDInterval, + metafor Remotes: jasp-stats/jaspBase, jasp-stats/jaspGraphs, From 91674869ac2e3844d312ebe1eea278eee799821b Mon Sep 17 00:00:00 2001 From: JTPetter <61797391+JTPetter@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:24:27 +0100 Subject: [PATCH 2/3] Fixes for effect sizes --- R/LSeffectSizes.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/LSeffectSizes.R b/R/LSeffectSizes.R index b6bbe25..66b11bb 100644 --- a/R/LSeffectSizes.R +++ b/R/LSeffectSizes.R @@ -517,7 +517,7 @@ switchOptions <- function(options) { rhoTable <- createJaspContainer() rhoTable$position <- 3 rhoTable$dependOn(c("effectSize", "effectSizeValueRho", "simulateData", "simulateDataN", - "rhoSharedVariance", "setSeed", "seed")) + "rhoSharedVariance", "setSeed", "seed", "explanatoryTexts")) jaspResults[["rhoTable"]] <- rhoTable @@ -712,7 +712,7 @@ switchOptions <- function(options) { if (options[["plotRhoRegression"]]) { plot <- plot + ggplot2::geom_abline( - intercept = mu2, + intercept = mu2 - (rho * (sigma2/sigma1)) * mu1, slope = rho * (sigma2/sigma1) ) } @@ -936,7 +936,7 @@ switchOptions <- function(options) { phiTable <- createJaspContainer() phiTable$position <- 3 - phiTable$dependOn(c("effectSize", "effectSizeValuePhi", "simulateData", "simulateDataN", "pX", "pY", "inputPopulation", "pX1Y1", "pX1Y0", "pX0Y1", "pX0Y0", "setSeed", "seed", "phiOR", "phiRR", "phiRD")) + phiTable$dependOn(c("effectSize", "effectSizeValuePhi", "simulateData", "simulateDataN", "pX", "pY", "inputPopulation", "pX1Y1", "pX1Y0", "pX0Y1", "pX0Y0", "setSeed", "seed", "phiOR", "phiRR", "phiRD", "explanatoryTexts")) jaspResults[["phiTable"]] <- phiTable From 54c83fb3c63a05ec9edee00be93e88442a1721ad Mon Sep 17 00:00:00 2001 From: JTPetter <61797391+JTPetter@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:42:50 +0100 Subject: [PATCH 3/3] Fix bug in descriptive statistics --- R/LSTdescriptives.R | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/R/LSTdescriptives.R b/R/LSTdescriptives.R index 11b8335..b994ddc 100644 --- a/R/LSTdescriptives.R +++ b/R/LSTdescriptives.R @@ -24,12 +24,18 @@ LSTdescriptives <- function(jaspResults, dataset, options, state = NULL) { data <- .getDataLSTdesc(jaspResults, options, inputType) #checking whether data is discrete or continuous, whereas only integers are treated as discrete - discrete <- ifelse(all(data$x == as.integer(data$x)), TRUE, FALSE) + integerData <- as.integer(data$x) + # conversion to integers fails with extreme values, if it failed for any value just treat it as continuous + if (any(is.na(integerData))) { + discrete <- FALSE + } else { + discrete <- ifelse(all(data$x == integerData), TRUE, FALSE) + } stats <- switch(options[["LSdescStatistics"]], - "LSdescMean" = "ct", "LSdescMedian" = "ct", "LSdescMode" = "ct", "LSdescMMM" = "ct", - "LSdescRange" = "spread", "LSdescQR" = "spread", "LSdescSD" = "spread", - "none" = "none") + "LSdescMean" = "ct", "LSdescMedian" = "ct", "LSdescMode" = "ct", "LSdescMMM" = "ct", + "LSdescRange" = "spread", "LSdescQR" = "spread", "LSdescSD" = "spread", + "none" = "none") if (options[["LSdescHistBar"]]) @@ -497,6 +503,7 @@ LSTdescriptives <- function(jaspResults, dataset, options, state = NULL) { variable <- variable[variable != ""] dataset <- .readDataSetToEnd(columns.as.numeric = variable) df <- data.frame(x = unlist(dataset)) + df <- na.omit(df) return(df) }