Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #470 +/- ##
==========================================
- Coverage 84.96% 84.89% -0.08%
==========================================
Files 18 18
Lines 10012 10332 +320
==========================================
+ Hits 8507 8771 +264
- Misses 1505 1561 +56 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| stop(gettextf("Error computing emmeans for terms '%s': %s. Prediction fallback failed: %s.", | ||
| paste(termNames, collapse = ", "), conditionMessage(e), conditionMessage(e2))) |
|
build bot build |
✅ Build Complete!Your JASP module bundles have been successfully built for macOS (ARM) and Windows. 👉 Click here to download the artifacts (Scroll to the bottom of the page to find the "Artifacts" section). |
JohnnyDoorn
left a comment
There was a problem hiding this comment.
- the placeholder plot shows when loading the analysis, which shouldn't be the case
- the options could be laid out across 2 columns
- For the interaction plots, would it maybe increase the clarity of the figures if you work with faded colors for the confidence bands, similar to the other descriptives plots in JASP? They currently do look nice and funky, but it's not so easy to get a clear idea of the interactions.
- the plots appear in the top, changing the plots triggers the main results which is probably not what is needed.
- to plot the interaction for continuous predictors there is some stratifying going on that can create messy labels - maybe you can take a look at how it's done in regression for stratifying continuous predictors: jasp-stats/jaspRegression#514
|
@JohnnyDoorn I addressed all other comments. I did not understand the last point though. Do you maybe have an example where the stratifying creates weird labels? |
|
@JohnnyDoorn any news on this? |
vandenman
left a comment
There was a problem hiding this comment.
Some basic remarks about the code, still have to run this in JASP though.
| stop(gettextf("Error computing emmeans for terms '%s': %s. Prediction fallback failed: %s.", | ||
| paste(termNames, collapse = ", "), conditionMessage(e), conditionMessage(e2))) |
| if (includeCi) { | ||
| pred <- stats::predict(model, newdata = grid, se.fit = TRUE) | ||
| df <- stats::df.residual(model) | ||
| tcrit <- stats::qt((1 + level) / 2, df) | ||
| emmean <- pred$fit | ||
| se <- pred$se.fit | ||
| lower <- emmean - tcrit * se | ||
| upper <- emmean + tcrit * se | ||
| } else { | ||
| emmean <- stats::predict(model, newdata = grid) | ||
| } | ||
|
|
||
| out <- grid[, termNames, drop = FALSE] | ||
| out$emmean <- emmean | ||
| if (includeCi) { | ||
| out$lower.CL <- lower | ||
| out$upper.CL <- upper | ||
| } | ||
|
|
||
| return(out) |
There was a problem hiding this comment.
Perhaps put out <- grid[, termNames, drop = FALSE] first to avoid doing twice if (includeCi) {?
| if (includeCi) { | |
| pred <- stats::predict(model, newdata = grid, se.fit = TRUE) | |
| df <- stats::df.residual(model) | |
| tcrit <- stats::qt((1 + level) / 2, df) | |
| emmean <- pred$fit | |
| se <- pred$se.fit | |
| lower <- emmean - tcrit * se | |
| upper <- emmean + tcrit * se | |
| } else { | |
| emmean <- stats::predict(model, newdata = grid) | |
| } | |
| out <- grid[, termNames, drop = FALSE] | |
| out$emmean <- emmean | |
| if (includeCi) { | |
| out$lower.CL <- lower | |
| out$upper.CL <- upper | |
| } | |
| return(out) | |
| out <- grid[, termNames, drop = FALSE] | |
| if (includeCi) { | |
| pred <- stats::predict(model, newdata = grid, se.fit = TRUE) | |
| df <- stats::df.residual(model) | |
| tcrit <- stats::qt((1 + level) / 2, df) | |
| emmean <- pred$fit | |
| se <- pred$se.fit | |
| out$lower <- emmean - tcrit * se | |
| out$upper <- emmean + tcrit * se | |
| } else { | |
| emmean <- stats::predict(model, newdata = grid) | |
| } | |
| out$emmean <- emmean | |
| return(out) |
| return(out) | ||
| } | ||
|
|
||
| .doeAnalysisNormalizeCiLevel <- function(level) { |
There was a problem hiding this comment.
Is this necessary? It looks like an AI-ism (😅) of something that should always be enforced by QML rather than by R?
| factorType <- .doeAnalysisPlotFactorType(factorName, options) | ||
| if (factorType == "continuous") { | ||
| emm[["x"]] <- as.numeric(emm[[factorName]]) | ||
| xBreaks <- sort(unique(c(min(emm[["x"]], na.rm = TRUE), max(emm[["x"]], na.rm = TRUE)))) |
There was a problem hiding this comment.
| xBreaks <- sort(unique(c(min(emm[["x"]], na.rm = TRUE), max(emm[["x"]], na.rm = TRUE)))) | |
| xBreaks <- sort(unique(c(range(emm[["x"]], na.rm = TRUE)))) |
range(x) returns c(min(x), max(x))
|
|
||
| if (xFactorType == "continuous") { | ||
| emm[["x"]] <- as.numeric(emm[[factorA]]) | ||
| xBreaks <- sort(unique(c(min(emm[["x"]], na.rm = TRUE), max(emm[["x"]], na.rm = TRUE)))) |
There was a problem hiding this comment.
range. Also the code around lines 2241 looks like a duplicate of the code here. Perhaps extract a common helper?
|
FYI: this is key functionality :-) |

Uh oh!
There was an error while loading. Please reload this page.