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]: Independent samples t-test error with Q-Q plots when missing data is present #2939

Open Alejandro-84 opened 2 weeks ago

Alejandro-84 commented 2 weeks ago

JASP Version

0.19.0

Commit ID

No response

JASP Module

T-Tests

What analysis are you seeing the problem on?

Independent Samples T-Test

What OS are you seeing the problem on?

Windows 10

Bug Description

When I run an independent samples t-test and check the box for "Q-Q plot residuals" under the "Assumption Checks" section, I get the Q-Q plot as expected (two groups of n = 6 each):

image

However, if I perform the same steps using the same variable but with one group having one missing value (two groups: group 1, n = 6; group 2, n = 5 [1 score missing]), the analysis stops, and I get this error message:

image

This problem disappears when the option of "Missing values" changes from "Exclude cases per dependent variable" to "Exclude cases listwise".

"Exclude cases per dependent variable" option: image

"Exclude cases listwise" option: image

What is interesting is that if you perform the test by using ANOVA, this problem does not occur.

ANOVA with all cases (two groups, n = 6 per group):

image

ANOVA with one missing score (two groups: group 1, n = 6; group 2, n = 5 [1 score missing]):

image

This is the dataset I used. T-test.qq.zip

Expected Behaviour

The Q-Q plot should be generated even though one group presents missing values (such as in ANOVA).

Steps to Reproduce

  1. Open JASP, have two dependent variables, one with full cases and another with at least one missing score, and one categorical independent variable.
  2. Open the T-Tests module and select the Independent Samples T-Test option.
  3. Drop the dependent variable with complete scores into the "Dependent Variables" box and add the independent variable into the "Grouping variable" box. Check the "Q-Q plot residuals" box under "Assumption checks." All should run normally.
  4. Drop the dependent variable with missing scores into the "Dependent Variables" box and add the independent variable into the "Grouping variable" box. Check the "Q-Q plot residuals" box under "Assumption checks"; the error window should appear. ...

Log (if any)

No response

More Debug Information

-------- Application Info -------- JASP Version: JASP 0.19.1 Build Branch: lockfiletesting Build Date: Sep 9 2024 19:00:04 (Netherlands) Last Commit: 8ac10c9c7aec029fdd695262d7bb4c3742a8ec89

-------- Basic Info -------- Operating System: Windows 10 Version 22H2 Product Version: 10 Kernel Type: winnt Kernel Version: 10.0.19045 Architecture: x86_64 Install Path: C:/Program Files (x86)/JASP Platfotm Name: windows System Local: en_CA

-------- Extra Info -------- Current code page Active code page: 437 Active code page: 65001

Final Checklist

tomtomme commented 2 weeks ago

@Alejandro-84 thx for the report. Confirmed on 0.19.1 flatpak. Also confirmed if missing is not at the end of the data set and if missing is coded as missing value.