- Small sample sizes: With small sample sizes, the assumptions of the statistical test might not be fully met, which could lead to issues with the calculation of the p-values. However, this is less likely to be the problem since the Tukey-Kramer method works fine.
- Zero variance or identical groups: If one or more groups have zero variance (i.e., all values in a group are identical), the Bonferroni method may fail to compute the p-values properly.
multcompare function: p-values are NaN if bonferroni method is used
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Dear Community,
I have datasets from four groups with sizes of n = 39, n = 15, n = 63, n = 10 and compare these via kruskalwallis yielding p = 0.012. I then attempt post hoc tests (bonferroni method) using the multcompare function as can be seen below. The respective column featuring the p-values displays NaN only. Why is that? When I do not use bonferroni method, but the default option (tukey-kramer) does not result in this problem.
Thank you in advance,
Hannah
z_data = [caps_z; atax_z; dys_z; all_z];
z_group = [ones(size(caps_z)); 2 * ones(size(atax_z));3 * ones(size(dys_z));4 * ones(size(all_z))];
[zP,zANOVATAB,zSTATS] = kruskalwallis(z_data, z_group);
z_posthoc = multcompare(zSTATS,'CType','bonferroni');
p_vals_z = find(z_posthoc(:,6)<0.05);
0 Commenti
Risposte (1)
Pratyush
il 15 Dic 2023
Hi Hannah,
I understand that you are getting 'NaN' values in the p-value column of the 'multcompare' output when using the 'bonferroni' method, which could be due to:
You should probably check the group sizes and variances to ensure there are no groups with zero variance.
0 Commenti
Vedere anche
Categorie
Scopri di più su Hypothesis Tests in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!