Skip to content

Commit

Permalink
Learn Stats: Fix 0.19.2 bugs (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
JTPetter authored Dec 6, 2024
1 parent 9881226 commit 9894d86
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Imports:
jaspTTests,
ggforce,
tidyr,
igraph
igraph,
HDInterval,
metafor
Remotes:
jasp-stats/jaspBase,
jasp-stats/jaspGraphs,
Expand Down
15 changes: 11 additions & 4 deletions R/LSTdescriptives.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"]])
Expand Down Expand Up @@ -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)
}

Expand Down
6 changes: 3 additions & 3 deletions R/LSeffectSizes.R
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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)
)
}
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 9894d86

Please sign in to comment.