-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding set seed to confidence interval analysis #90
Conversation
Adding a set seed option to the confidence interval analysis in the Learn Stats module. Additionally, adding a dependency for the tree plot table, so it disappears when the check box is no longer selected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An issue is that the output (tables and figures) do not refreshe once seed is set / changed. (The data are correctly simulated and stored in the container, however, since both seed dependencies are not on the output elements, they do not change-they were already created. -- I can explain a bit more about the states and output logic of JASP in person on Thursday)
I think a question is where the Set seed
option would fit the best in the menu. Do you have any preference @EJWagenmakers ? I think it would might be better hidden at the bottom of the menu?
Also, should we also add this to the remaining analyses in the "Learn Stats" module since we are already looking into it?
R/LSTconfidenceIntervals.R
Outdated
return() | ||
} | ||
|
||
.getConfidenceContainer <- function(jaspResults) { | ||
confidenceContainer <- jaspResults[["confidenceContainer"]] %setOrRetrieve% createJaspContainer(dependencies = c("mu", "sigma", "n", "confidenceIntervalInterval", "nReps", "treePlot")) | ||
confidenceContainer <- jaspResults[["confidenceContainer"]] %setOrRetrieve% createJaspContainer(dependencies = c("mu", "sigma", "n", "confidenceIntervalInterval", "nReps", "treePlot", "seed")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confidenceContainer <- jaspResults[["confidenceContainer"]] %setOrRetrieve% createJaspContainer(dependencies = c("mu", "sigma", "n", "confidenceIntervalInterval", "nReps", "treePlot", "seed")) | |
confidenceContainer <- jaspResults[["confidenceContainer"]] %setOrRetrieve% createJaspContainer(dependencies = c("mu", "sigma", "n", "confidenceIntervalInterval", "nReps", "treePlot", "setSeed", "seed")) |
The SetSeed{}
QML function actually has two parts, the checkbox (for enabling/disabling the seed) and the integerfield with the actual seed value. You need to set both into the dependencies, otherwise disabling the checkbox would not re-generate new results with a random seed (the expected behavior when seed is disabled).
You can check the option names used by checking the R code of the .setSeedJASP()
function:
> jaspBase::.setSeedJASP
function(options) {
if (is.list(options) && all(c("setSeed", "seed") %in% names(options))) {
if (isTRUE(options[["setSeed"]]))
set.seed(options[["seed"]])
} else {
# some analysis (t-test) have common functions for computations, however, only some of the offer seed in the interface - therefore, this error message is disabled for the moment
# stop(paste(".setSeedJASP was called with an incorrect argument.",
# "The argument options should be the options list from QML.",
# "Ensure that the SetSeed{} QML component is present in the QML file for this analysis."))
}
}
Yes, hidden seems better... |
1) Adding dependency on checkbox 2) Changing position of Repeatability to be at the end after divider
Adding a set seed option to the confidence interval analysis in the Learn Stats module.
Additionally, adding a dependency for the tree plot table, so it disappears when the check box is no longer selected.
fix: jasp-stats/jasp-issues#2993