Open tomtomme opened 10 months ago
@tomtomme, thanks for taking the time to create this issue. If possible (and applicable), please upload to the issue website (https://github.com/jasp-stats/jasp-issues/issues/2529) a screenshot showcasing the problem, and/or a compressed (zipped) .jasp file or the data file that causes the issue. If you would prefer not to make your data publicly available, you can send your file(s) directly to us, issues@jasp-stats.org
We have a project to generate Help file from the QML info properties: each option, section or group should have an info property with some translatable text. This will generate automatically the help md file, but also the ROxygene with R Syntax.
@boutinb
Sounds like a major effort to implement. How about implementing AI-generated docs in the meantime until we have better ones? How does the quality of your doc-generator compare to the AI-generator? For reference, the following is the AI-generated documentation for the "contingency tables" module generated in minutes:
Contingency Tables The contingency tables module allows the user to test whether two categorical variables are independent or associated. The analysis returns a chi-squared test and other measures of association for each pair of variables in a contingency table. The module can also handle variables with more than two levels.
Assumptions • The variables should be categorical (nominal or ordinal). • Observations should be independent. • Expected frequencies should be at least 5 for most cells in the table.
Input • Rows: The variable that defines the rows of the contingency table. • Columns: The variable that defines the columns of the contingency table. • Counts: The variable that contains the frequency counts for each cell in the contingency table. If this is not specified, each observation is assumed to have a count of 1. • Layer: The variable that defines additional layers of the contingency table. This can be used to create a series of 2x2 tables for each level of the layer variable.
Statistics • Chi-Squared Tests: Performs a chi-squared test of independence for the contingency table. The output includes the chi-squared statistic, the degrees of freedom, the p-value, and the Vovk-Sellke maximum p-ratio. Optionally, a continuity correction can be applied for 2x2 tables, and a likelihood ratio test can be reported as well. • Log Odds Ratio: Computes the log odds ratio and its confidence interval for 2x2 tables. The output includes the log odds ratio, the lower and upper bounds of the confidence interval, and the p-value from Fisher's exact test. • Nominal: Computes measures of association for nominal variables. The output includes the contingency coefficient, the phi-coefficient, the Cramer's V, and the lambda coefficients (rows, columns, and symmetric). • Ordinal: Computes measures of association for ordinal variables. The output includes the gamma coefficient and its confidence interval, and the Kendall's tau-b coefficient, its p-value and the VS-MPR.
Output Contingency Tables • The table shows the counts of observations summarized in a contingency table. The output includes the observed count, the expected count, the percentage within row, the percentage within column, the percentage of total, the unstandardized residual, the Pearson residual, and the standardized residual for each cell in the table. The output also includes the row, column, and grand totals.
Chi-Squared Tests • Χ²: The chi-squared statistic for testing the independence of the variables. • df: The degrees of freedom for the chi-squared test. • p: The p-value for the chi-squared test. • VS-MPR: The Vovk-Sellke maximum p-ratio, which indicates the maximum possible odds in favor of the alternative hypothesis over the null hypothesis, based on the p-value. • Χ² continuity correction: The chi-squared statistic with a continuity correction, which reduces the discrepancy between the discrete and continuous distributions for 2x2 tables. • Likelihood ratio: The likelihood ratio statistic, which is based on the ratio of the maximum likelihoods of the null and alternative hypotheses. • N: The total number of observations in the contingency table.
Log Odds Ratio • Log Odds Ratio: The natural logarithm of the odds ratio, which is the ratio of the odds of an event occurring in one group to the odds of it occurring in another group. • Lower: The lower bound of the confidence interval for the log odds ratio. • Upper: The upper bound of the confidence interval for the log odds ratio. • p: The p-value from Fisher's exact test, which is based on the hypergeometric distribution of the cell counts for 2x2 tables.
Nominal • Contingency coefficient: A measure of association for nominal variables, ranging from 0 (no association) to 1 (complete association). It is based on the chi-squared statistic and the sample size. • Phi-coefficient: A measure of association for nominal variables, ranging from -1 (negative association) to 1 (positive association). It is equivalent to the Pearson correlation coefficient for dichotomous variables. • Cramer's V: A measure of association for nominal variables, ranging from 0 (no association) to 1 (complete association). It is a normalized version of the phi-coefficient that takes into account the degrees of freedom of the contingency table. • Lambda (rows): A measure of association for nominal variables, ranging from 0 (no association) to 1 (complete association). It is the proportional reduction in error when predicting the row variable from the column variable, compared to the marginal distribution of the row variable. • Lambda (columns): A measure of association for nominal variables, ranging from 0 (no association) to 1 (complete association). It is the proportional reduction in error when predicting the column variable from the row variable, compared to the marginal distribution of the column variable. • Lambda (symmetric): A measure of association for nominal variables, ranging from 0 (no association) to 1 (complete association). It is the average of the lambda coefficients for the rows and columns.
Ordinal • Gamma: A measure of association for ordinal variables, ranging from -1 (negative association) to 1 (positive association). It is based on the difference between the number of concordant and discordant pairs of observations, divided by the total number of pairs. • Standard Error: The standard error of the gamma coefficient, which is used to compute the confidence interval. • Lower: The lower bound of the confidence interval for the gamma coefficient. • Upper: The upper bound of the confidence interval for the gamma coefficient. • Kendall's Tau-b: A measure of association for ordinal variables, ranging from -1 (negative association) to 1 (positive association). It is based on the difference between the number of concordant and discordant pairs of observations, divided by the square root of the product of the number of pairs not tied on the row variable and the number of pairs not tied on the column variable. • Z: The test statistic for testing the null hypothesis that Kendall's tau-b is zero. • p: The p-value for the test of Kendall's tau-b. • VS-MPR: The Vovk-Sellke maximum p-ratio for the test of Kendall's tau-b.
@tomtomme @boutinb yes I think using some AI generation is the way to go here (and I understand from some colleagues that we won't be unique in this) - it will simply be unmanageable to have all documentation written from scratch. I would suggest to have it included in the standard module development workflow, such that the analysis creator simply has to fact-check the generation documentation.
Just a note: If there is at some point a plan on pursuing the generative-AI part, then I suggest to look at this benchmark first: https://simple-bench.com/
It is quite a hard multiple-choice benchmark where even the best AI currently only reaches half the points a normal human could do.
The ranking shows that openAIs models are currently lacking, except the paid o1-preview. Claude Sonnet 3.5 is the best free LLM atm. But this is at a constant flow. So looking at that leaderboard next week may result in other conclusions.
Still valid for 0.19.2 beta
Meta-bug to collect modules with missing/lacking help files from all issues around. Closed issue mark on references to the old issues do not mean, that those documentation is fixed now. This will be shown by marked tick boxes
One attempt to generate docs via Claude/CoPilot as a first is documented here https://github.com/jasp-stats/jasp-issues/issues/946 This involved a step-by-step procedure that
Completely missing help files
946
Lacking help files
Template to train AI
I have quite an important task. I need you to write documentation on JASPs "contingency tables" module that resides in the Frequencies section. Almost every JASP module has a complete help file that explains all available options short and precise, but not this one. To insure that the documentation you will write is correct, you will follow a step by step procedure.
Understood?
You understood correctly. Please notice that I am writing in english and also said documentation should be in english. Here is the example. It is the help file of the module "...":
That PDF documents all examples from JASPs data library. Maybe it is also of help writing said documentation. Now follows the html formated file of the example. Note: I have ticked all available analysis options in JASP, thus the results will be more detailed than in the referenced PDF above. The documentation needs to cover all options, not just those referenced in the PDF:
...input the results here ...
Great. I confirm that you shall proceed. Thanks.
Nice. Can you now add
a) appropriate line breaks at the bullet points, headings and sub-headings
b) Do not include the sections about ... in the revised version, since those are not implemented yet. Stick to the facts and features implemented today.
c) more detail to the calculations and formulas used for the different statistical measures. But maybe only for those, where more than one formula variant exists, so that the reader knows, which variant was used. You may find hints for the actual formulas on github in jasps source code. Please do not add those calculations details, if you are unsure about them.