jasp-stats / jasp-issues

This repository is solely meant for reporting of bugs, feature requests and other issues in JASP.
58 stars 29 forks source link

[Bug]: Non parametric correlations (Spearman's & Kendall's tau) both return NaN since 0.17.1 #2022

Closed JonRees68 closed 1 year ago

JonRees68 commented 1 year ago

JASP Version

0.17.1

Commit ID

No response

JASP Module

Regression

What analysis are you seeing the problem on?

Correlation - non parametric only

What OS are you seeing the problem on?

Windows 11

Bug Description

Requesting Spearman or Kendall tau results in NaN returned for both value of test statistic and p value - tested with a number of data sets. Worked on 0.17 until i upgraded this morning

Expected Behaviour

Should produce the test statistic and p value

Steps to Reproduce

Simlply ask for a non parametric corelation

Log (if any)

No response

Final Checklist

github-actions[bot] commented 1 year ago

@JonRees68, 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/2022) 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

boutinb commented 1 year ago

@Kucharssim: I see that by adding a partial out variable, and removing it, then the NA values disappear...

tomtomme commented 1 year ago

for me if at least one of the variables is ordinal, both work, but pearson does not - sometimes. It seems to be random. Sometimes the scale of measurement does not seem to matter and everything works... sometimes NaN appear.

Would be interesting if the coefficients would respect the niveau of measurement. However: It is sometimes sensible to use Kendals Tau instead of Pearsons r even if both are metric scale. For example if many outliers or heavily skewed distributions are present.

Kucharssim commented 1 year ago

@JonRees68,

thank you for reporting the bug. I can reproduce the error as well, but can you confirm that the requested coefficients appear as desired if you either 1) refresh the analysis, or 2) first select the Spearman and Kendall coefficient and only then add the variables to the list?

@tomtomme, thanks for the insight, but I am afraid this is not a feature, but a bug. It is probably a state issue where the analysis tries to be "clever" and to avoid recomputing certain statistics if they were already computed. It seems though that we are not catching correctly if additional coefficients are requested and so we erroneously do not compute them.

For now it should be possible to bypass the bug as I described above (e.g., refreshing the analysis). I will fix it for the next release.

JonRees68 commented 1 year ago

Ah indeed. I can confirm those. It also calculated it if you try and partial something out and then remove the partialling out variable.

Thanks for your swift response. Have to say jasp rules and my students love it. And now I've had a chance to explain to them what NaN means too.

Cheers

Jon

Dr Jon Rees

Senior Lecturer in Psychology School of Psychology

Faculty of Health Sciences and Wellbeing University of Sunderland

(Friday is AHSN research day and not available for teaching related issues)

https://www.researchgate.net/profile/Jon_Rees2https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.researchgate.net%2Fprofile%2FJon_Rees2&data=04%7C01%7C%7Cfb2b0d5d55484489a0ea08d890842391%7C16a0d960ee744f56a22a19ae057918b2%7C0%7C0%7C637418244484129039%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=jZOF26fhRhMlCq1ixO9wkIhz%2BXXyhU%2BaZFvh0DPTYTY%3D&reserved=0

https://orcid.org/0000-0002-3295-244X

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Simon Kucharsky @.> Sent: Monday, February 20, 2023 4:38:32 PM To: jasp-stats/jasp-issues @.> Cc: Jon Rees (Staff) @.>; Mention @.> Subject: [EXT] Re: [jasp-stats/jasp-issues] [Bug]: Non parametric correlations (Spearman's & Kendall's tau) both return NaN since 0.17.1 (Issue #2022)

@JonRees68https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FJonRees68&data=05%7C01%7C%7C13962732268043034e1b08db1360e7e2%7C16a0d960ee744f56a22a19ae057918b2%7C0%7C0%7C638125079146155324%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=TjZe1vctinKXsjFDOq3r9dihKvU5AP400yUTIEFe63E%3D&reserved=0,

thank you for reporting the bug. I can reproduce the error as well, but can you confirm that the requested coefficients appear as desired if you either 1) refresh the analysis, or 2) first select the Spearman and Kendall coefficient and only then add the variables to the list?

@tomtommehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftomtomme&data=05%7C01%7C%7C13962732268043034e1b08db1360e7e2%7C16a0d960ee744f56a22a19ae057918b2%7C0%7C0%7C638125079146155324%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ukXI1%2FzdX%2B%2FeBpk8nI2oWaCel6TaoQ2%2B%2FYW51tR%2F03U%3D&reserved=0, thanks for the insight, but I am afraid this is not a feature, but a bug. It is probably a state issue where the analysis tries to be "clever" and to avoid recomputing certain statistics if they were already computed. It seems though that we are not catching correctly if additional coefficients are requested and so we erroneously do not compute them.

For now it should be possible to bypass the bug as I described above (e.g., refreshing the analysis). I will fix it for the next release.

— Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjasp-stats%2Fjasp-issues%2Fissues%2F2022%23issuecomment-1437293665&data=05%7C01%7C%7C13962732268043034e1b08db1360e7e2%7C16a0d960ee744f56a22a19ae057918b2%7C0%7C0%7C638125079146155324%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=6P%2BU5bQjpD6yfyozOQtPpXwvEeXhKhG2C31lBWBCZlo%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAP4NYDGATTVD37PX437G2TDWYOMYRANCNFSM6AAAAAAU6KCNSA&data=05%7C01%7C%7C13962732268043034e1b08db1360e7e2%7C16a0d960ee744f56a22a19ae057918b2%7C0%7C0%7C638125079146155324%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=0w3joUiWB9FdPyA7Q4GWYvlDJqPUdMYUSy%2BEJ%2FLPlrQ%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

[We are a life-changing university]https://www.sunderland.ac.uk

DISCLAIMER: The information contained in this email is intended for the named recipient only. It may contain confidential information. If you are not the intended recipient, you must not copy, distribute, or take any action in reliance on it. If you have received this email in error please advise the sender by return email and delete all copies. The University of Sunderland cannot guarantee that this message or any attachment is virus free or has not been intercepted and amended. You should perform your own virus checks.