Contingency table not including all values

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
Ember
Posts: 2
Joined: Thu Jan 05, 2023 8:50 am

Contingency table not including all values

Post by Ember »

Hi,
I'm doing a chi-squared/Fisher's exact test with a data set of 26 samples in group A and 21 in group B. Looking at the contingency table however it only includes 21 values, i.e. it doesn't include the 5 last values from group A. Is that how the contingency table/program works or is there something wrong going on? Shouldn't the analysis include all 47 values? I mean, the results differs quite a lot depending on what values are put in row 22-26 (thus not being included in the analysis).

I'm quite new to all statistics and been stuck trying to figure this out for days now, so I truly appreciate some advice here!

Thanks and all the best,
Emma
User avatar
jonathon
Posts: 2620
Joined: Fri Jan 27, 2017 10:04 am

Re: Contingency table not including all values

Post by jonathon »

attach a .omv file here (you may need to zip it up first) and we'll take a look.
Ember
Posts: 2
Joined: Thu Jan 05, 2023 8:50 am

Re: Contingency table not including all values

Post by Ember »

Attaching a copy of a part of the main file, but the main looks the same...

Thank you in advance!
Attachments
Data example.omv
(7.16 KiB) Downloaded 59 times
User avatar
jonathon
Posts: 2620
Joined: Fri Jan 27, 2017 10:04 am

Re: Contingency table not including all values

Post by jonathon »

so contingency tables work on pairs of observations -- in the case of your data, you've got 21 complete pairs, and so that's what shows up in your contingency table.

the contingency table summaries all the different combinations:

yes, yes
yes, no
no, yes
no, no

but if some of your pairs are missing values, they can't be summarised like this. if you do want to include the missing values, then assign them a value.

cheers
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: Contingency table not including all values

Post by MAgojam »

Hey Emma,
I had a look at your attached file.

I can tell you that the contingency tables do their job correctly, but I suggest your own control over the data.
Note that your file has three blank lines (27:29) for the four variables, which should be deleted.
Is the presence of NA to indicate missing data or is it one more level than Yes and No?
If NA is for missing data you should indicate it (with "Data>Setup>Missing values" on the variable), otherwise it will be interpreted as another level of the variable.
The Chi-squared test of association predicts that the total of the row or column marginals is the observed true between the combinations of the various levels of the two row and column variables.
If you bring NA as the missing value for both Alcohol A and B, it will be 14 in the contingency table for the two variables.
Are you sure using a Chi-squared association is what you need?

Cheers,
Maurizio
Post Reply