Skip to content
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

[Feature Request]: Rename BF10 when comparing to best model? #129

Open
quentingronau opened this issue Dec 15, 2017 · 20 comments
Open

[Feature Request]: Rename BF10 when comparing to best model? #129

quentingronau opened this issue Dec 15, 2017 · 20 comments

Comments

@quentingronau
Copy link

Personally, I find it a bit confusing that when the option "Compare to best model" is selected, the output table says "BF10" which is in fact not the Bayes factor against the null model but against the best model. Maybe we could change this in the tables/interface to something more informative?

@juliuspfadt
Copy link
Contributor

@EJWagenmakers, any thoughts?

@EJWagenmakers
Copy link
Collaborator

In that case we could replace the "0" by a "b" in the subscripts. However this may create confusion as well. What do you think, @JohnnyDoorn @vandenman

@JohnnyDoorn
Copy link

This is indeed a confusing thing!
My suggestion: replace 1 and 0 with R and B (or 0, if comparing to null) and add a footnote to explain the subscript:
image
So here we would have BF_{R, B} as the column header, and add a footnote along the lines of

BF{R, B} denotes the model comparison between the model in each row (R), and the best model (B).

and if comparing to null model

BF{R, 0} denotes the model comparison between the model in each row (R), and the null model (0).

@vandenman do you agree? Then I can update the code (also for Bayesian regression?).

@vandenman
Copy link
Contributor

I agree with the change, and in fact wanted to implement this sometime in the past. It's a bit more difficult to implement than you'd think though. The main issue is that we use Unicode for subscript 0 and 1 but unfortunately the subscript b does not exist in Unicode... (see https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts#Latin,_Greek_and_Cyrillic_tables). Instead you have to somehow use html tags but those are (intentionally) removed in jaspTables so this will require some more work.

@JorisGoosen do you remember what needs to be done to allow for HTML tags in jaspTables?

@JorisGoosen
Copy link
Contributor

We could simply add a workaround for the HTML removal part to not remove those subscripts?

@JorisGoosen
Copy link
Contributor

JorisGoosen commented Apr 14, 2023

Only thing necessary is changing escapeHtmlStuff to:

	inline static std::string escapeHtmlStuff(std::string input)
	{
		input = replaceBy(input, "&", 			"&");
		input = replaceBy(input, "<", 			"&lt;");
		input = replaceBy(input, ">", 			"&gt;");
		input = replaceBy(input, "&lt;sub&gt",	"<sub>");
		input = replaceBy(input, "&lt;/sub&gt",	"</sub>");

		return input;
	}

@Kucharssim
Copy link
Member

Another alternative would be to implement LaTeX expressions in our output. That would be nice and enable much more cool functionality, but since my light testing of KaTeX (https://github.com/jasp-stats/INTERNAL-jasp/issues/395) I did not have any time to push this forward.

@vandenman
Copy link
Contributor

Another alternative would be to implement LaTeX expressions in our output.

That would be much more complicated, although it would allow for some nicer output. I think for the short-term we could create a function like asHTML("text") which sets an attribute on the string that tells jaspTable it should not run escapeHtmlStuff on it. That way we can also reuse it when setting data, e.g.,

tb <- createJaspTable()
tb$addColumnInfo(name = "data", title = asHTML("BF<sub><B1/sub>"))
tb[["data"]] = asHTML(paste0("data<sub>", letters, "</sub>"))

which would then show up like so

BFB1
dataa
datab
...
datay
dataz

alternatively, we could add two arguments to $addColumnInfo like escapeHTMLinTitle and escapeHTMLinData.

@Kucharssim any preferences for either approach? perhaps adding two more arguments to $addColumnInfo is more discoverable?

@Kucharssim
Copy link
Member

That would be much more complicated

Well it doesn't have to be that difficult, see jasp-stats/jasp-desktop#5073. Considering @shun2wang picked this up and it looks like we could potentially have LaTeX support already for the next release, I would prefer to handle it that way than adding short-term solutions, otherwise we'll end up having to support both approaches. But I don't mind too much if we go this way - it obviously depends on how pressing this issue is.

@shun2wang
Copy link
Contributor

shun2wang commented Apr 25, 2023

Well, I'm not sure if that will go into 0.17.2, some testing is needed there. if we want to have a short-term solution that would probably be a low risky and it's easy to clean it up after 0.17.2 be released?

I don't have any particular preference for this Katex.js but it's an adjunct for me to import formula for JASP note, in fact it's easy to use with jaspHtml too😀

you can comment on this PR jasp-stats/jasp-desktop#5073 and I will have a look if something need to be done.

@Kucharssim
Copy link
Member

Well, I'm not sure if that will go into 0.17.2

definitely not in 0.17.2, I meant the one after that

@JorisGoosen
Copy link
Contributor

The fix I mention in #129 (comment) should be real easy, low errorchance and should allow for <sub> and </sub> in jaspHtml/jaspTable/etc without it getting messed up.

I can do this in like 5 minutes right now for 0.17.2. And I can also add <sup> and </sup>
Then for 0.17.3 or 0.18 we have katex support as well, but these fixes should only have as a sideeffect that people who have <sup> etc in their data might get some missing output?

@shun2wang
Copy link
Contributor

In katex I seted only render a formula with$$formula$$or \\begin formula \\end as elements to be render which will including into a span class name of katex katex-mathml katex-html things, so I am not sure if <sup> will be missing Maybe I misunderstood the meaning?

@JorisGoosen
Copy link
Contributor

JorisGoosen commented Apr 25, 2023

The <sup> thing is specifically for the quick fix I suggest in #129 (comment)

Im just assuming if subscript is wanted superscript is too?

Not related to katex

@JorisGoosen
Copy link
Contributor

Ill just make a branch of this

@JorisGoosen
Copy link
Contributor

image

@JorisGoosen
Copy link
Contributor

image

JorisGoosen added a commit to jasp-stats/jaspColumnEncoder that referenced this issue Apr 25, 2023
JorisGoosen added a commit to JorisGoosen/jasp-desktop that referenced this issue Apr 25, 2023
Also show richtext in column names and data-items
@JorisGoosen
Copy link
Contributor

It should also work in everything else btw

RensDofferhoff pushed a commit to jasp-stats/jasp-desktop that referenced this issue Apr 26, 2023
Also show richtext in column names and data-items
JorisGoosen added a commit to jasp-stats/jaspColumnEncoder that referenced this issue Jun 20, 2023
* dont replace `<sub>`, `</sub>`, `<sup>` and `</sup>` in escapeHtmlStuff

* keep <sub> et al intact for jasp-stats/jasp-issues#129
@tomtomme tomtomme added the Bug: Low Bugs that has little impact on the main functionality, and their fix can be easily postponed. label Jan 11, 2024
@tomtomme
Copy link
Member

tomtomme commented Feb 18, 2024

@Kucharssim @JohnnyDoorn
So it seems @JorisGoosen merged the patch needed to convert from BF10 to BFRB (see #129 (comment))

But the tables in ANOVA and Regression still need to be updated to use that code and show BFRB.
Tested with current jasp 0.19 beta

@tomtomme tomtomme added Bug: Medium Bugs that don't influence the basic function of the app, but it's better to fix them at some point. and removed Bug: Low Bugs that has little impact on the main functionality, and their fix can be easily postponed. labels May 25, 2024
@tomtomme
Copy link
Member

tomtomme commented May 25, 2024

still valid with flatpak 0.19.2 beta (december 2.), see BF10 instead of BF_{R, B} in table header, see:
test.jasp.zip

@tomtomme tomtomme changed the title Rename BF10 when comparing to best model? [Bug] Rename BF10 when comparing to best model? Jan 6, 2025
@tomtomme tomtomme changed the title [Bug] Rename BF10 when comparing to best model? [Bug]: Rename BF10 when comparing to best model? Jan 6, 2025
@tomtomme tomtomme added Feature Request and removed Bug: Medium Bugs that don't influence the basic function of the app, but it's better to fix them at some point. labels Jan 22, 2025
@tomtomme tomtomme changed the title [Bug]: Rename BF10 when comparing to best model? [Feature Request]: Rename BF10 when comparing to best model? Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests