Skip to content

Conversation

jvli4n
Copy link

@jvli4n jvli4n commented Jul 4, 2025

Type 2 & 3 Bayesian gauge r&R analysis

jvli4n added 28 commits May 15, 2025 20:25
- Initial QML & R-code development
Adding model comparison and analysis of effects output tables based on the BayesFactor package
R code for Bayesian variance components table
1) Fitting metalog distribution to MCMC samples

2) Plotting posteriors based on metalogs with option to query them

3) Removing analysis of effects and comparing full vs. main effects model instead. Here, I added the option to choose the model manually or based on the BF in favour of the full model.
- QML and R code for contour plot
- Update renv lock file
- Separate % Contribution table
- Risk table that goes along with contour plot
- Gauge evaluation output now includes separate tables with uncertainty estimates
- Allowing to fit metalog or generalised inverse Gaussian to MCMC samples

- Merging some of the output tables together
- Correction of the calculations for variance parameters

- Storing % Contribution, Study Variation and Tolerance as JaspStates for plotting
1) Adding posteriors for percentages

2) Adding descriptive plots that are already part of the frequentist module
1) Adding plot for g-prior

2) Function for conversion from wide to long format
- Adding variance components and traffic light charts to Bayesian module

- Adjusting plotting functions from frequentist module to include intervals
Adding diagnostics table
1) Adding footnotes to tables

2) Adding diagnostic plots

3) Changing axis limits and breaks for posterior plots as well as how functions are fit to the MCMC samples
- New data structures for storing MCMC samples since the old ones seemed to lead to errors in JASP
1) Fixing trace plot y limits

2) Manual plot for autocorrelations with multiple chains in one plot
- Adding histogram outlines for MCMC samples

- Adjusting y-limit functions accordingly

- Moving footnote for posterior summary table so it is only displayed if CrI is enabled
- Adding report with metadata and plots
- Code for adding tables to gauge r&R report

- Update dependencies
- Fixing dependencies & posterior plots

- Adding number of distinct categories

- Cleaning up the code
- Unit tests and snapshots
1) adding help file

2) updating dependencies and functionality of r&R table checkbox in the code

3) code clean-up

4) updating unit tests
@jvli4n jvli4n requested review from JTPetter and vandenman July 4, 2025 11:41
jvli4n and others added 11 commits July 21, 2025 17:49
Co-authored-by: Don van den Bergh <donvdbergh@hotmail.com>
Co-authored-by: Don van den Bergh <donvdbergh@hotmail.com>
Co-authored-by: Don van den Bergh <donvdbergh@hotmail.com>
Co-authored-by: Don van den Bergh <donvdbergh@hotmail.com>
Co-authored-by: Don van den Bergh <donvdbergh@hotmail.com>
jvli4n and others added 13 commits July 22, 2025 18:39
- moving data reading, error checking etc. to sub-functions

- translations

- Edit to .rmNewLine function: Now also removes new line at the end of the string.

- Manually specifying 2 chains in the unit tests as the default was changed to 4
- clean up & adding dependencies

- assigning colnames to data frames within the .fillTablesGaugeEval function

- fixing translation

- removing some unnecessary QML code
- Adjusting use of .controlChart function and unit tests

- Fixing translation issues
Making sure that plots get unchecked in case type 3 analysis is selected when the checkbox is enabled
jaspResults[["variancePosteriors"]] <- variancePosteriors

if(!ready) {
jaspResults[["variancePosteriors"]][["plot"]] <- createJaspPlot(width = 600, height = 320)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also add a title to the placeholder plots

bfTest <- .runBFtest(jaspResults, dataset, measurements, parts, operators, options, ready)

# Model comparison table
if(options[["RRTable"]] && !options$report){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stylistic remark: It would probably be better to stick with either option[["option"]] or option$option; I prefer the former.

.fitDistToSamples(jaspResults, options, ready)

# insert report here
if(options$report) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stylistic remark: I believe it's JASP style to use a space after if and for. Also no curly brackets for single line if-statements.

@JTPetter
Copy link
Contributor

Looks great to me @jvli4n ! I added a few comments, but I could not find anything substantial. I also did a quick test run in JASP and seems to work fine.

Before merging this, we might want to consider where this should be located. I don't think the current location in the menu, right below the classical gauge r&R is ideal. I would suggest either a subheading ("Bayesian analyses") within the module or even a whole different module.

@jvli4n
Copy link
Author

jvli4n commented Jul 30, 2025

@JTPetter you are right about the location of the analysis. I already talked to @EJWagenmakers about this, and it is probably best to create a new module for the Bayesian analyses.

jvli4n added 2 commits August 12, 2025 10:56
- Allowing the user to query the posterior based on data cut-off

- Clean-up

- Corresponding changes to unit tests
- Fixing bug in determining axis limits

- Updating corresponding snapshots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants