Bug in correlation heatmap?

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
anbech
Posts: 6
Joined: Fri Sep 16, 2022 10:25 pm

Bug in correlation heatmap?

Post by anbech »

Hi :-)

There is a large discrepancy between the correlations I get using factor -> reliability -> 'correlations heatmap' and the ones I get using the standard menu (regression -> correlation matrix). See screenshots below. I have also attached the data file.

Is this a bug, or is there something I don't understand about the correlations heatmap in the reliability menu? My assumption is that both methods should produce the same simple item-item correlations.

I am using Jamovi v. 2.6.19.

This is the heatmap:
jamovi_corr_heatmap.png
jamovi_corr_heatmap.png (58.65 KiB) Viewed 35634 times
Notice, for instance, the several negative correlations for variable i10.
For example the correlation btw. i10 and 20 is reported as -0.64

When I calculate that same correlation pair using regression -> correlation matrix I get a positive pearson's r of 0.48, which seems reasonable given the scatter plot:
jamovi_scatter.png
jamovi_scatter.png (23.58 KiB) Viewed 35634 times
This is just an example. The discrepancies are all over the place, check out the full correlation matrix from the regression menu in my attached .omv file.

Best regards
Anders
Attachments
correlation_heatmap_error.omv
(58.4 KiB) Downloaded 7203 times
anbech
Posts: 6
Joined: Fri Sep 16, 2022 10:25 pm

Re: Bug in correlation heatmap?

Post by anbech »

Note: I downgraded to 2.3.38 with the same result.
anbech
Posts: 6
Joined: Fri Sep 16, 2022 10:25 pm

Re: Bug in correlation heatmap?

Post by anbech »

Update:
It seems that there is also something wrong with the alpha calculations?

Notice for instance 'alpha when item dropped' for i04 in this screenshot: it says 0.64, while alpha for the whole scale is 0.74
jamovi_alpha.png
jamovi_alpha.png (16.41 KiB) Viewed 35625 times

However, if I remove i04 from the scale, alpha rises to 0.86
jamovi_alpha_item_dropped.png
jamovi_alpha_item_dropped.png (11.51 KiB) Viewed 35625 times
:thinking: :thinking:
User avatar
Ravi
Posts: 200
Joined: Sat Jan 28, 2017 11:18 am

Re: Bug in correlation heatmap?

Post by Ravi »

Hi!

I found the issue: it’s due to how each analysis handles missing values. The correlation matrix uses pairwise deletion, while the reliability analysis applies listwise deletion. Since your dataset has a lot of missing data, listwise deletion removes far more cases than pairwise deletion. When I apply a filter in jamovi to emulate listwise deletion, the results of the correlation heatmap and matrix align (see attached file).

This also explains the "alpha when item dropped" issue. Here, alpha is calculated using the same dataset (with all missing data removed listwise) but without the item. However, dropping an item can alter the dataset, as cases excluded before may now be included, which affects the alpha calculation.

I think it makes sense to use listwise deletion for reliability analysis, as alpha requires complete cases. That said, it might be helpful to inform users about missing value handling and the number of cases omitted. I’ll consider how we can improve this.

Thanks for your questions!

Cheers,
Ravi
Attachments
correlation_heatmap_error.omv
(69.91 KiB) Downloaded 8111 times
anbech
Posts: 6
Joined: Fri Sep 16, 2022 10:25 pm

Re: Bug in correlation heatmap?

Post by anbech »

Thanks a lot, Ravi, for looking into this. Glad that you could pinpointed the issue.
Yes, a warning text in the output about omitted cases would be very helpful.
Thanks again👍
Post Reply