1
$\begingroup$

I have one sample where participants saw ten images, and I am interested in whether there is a difference in which image got noticed first. So I have count data for this where each image will have the frequency of participants that looked at it first. My data looks like this.

A     5
B     4
C    11
D     2
E     0
F     5
G     6
H     0
I     3
J     4

Chi-square multinominal test does not fit my aim. I read about the Negative Binomial (NB) regression model (since I have entries with zero frequencies) and am unsure if it serves my purpose. Could anyone help?

$\endgroup$
6
  • 2
    $\begingroup$ Can you please explain the aim and how a $\chi^2$ one-way test won't fit it? If anything this seems like a standard application of it. I suppose in this case having expected frequencies of 4 is somewhat of an issue but aside from that what is the aim? (In which case we should use bootstrap to get our $p$-value.) $\endgroup$
    – usεr11852
    Commented Feb 24, 2023 at 12:35
  • $\begingroup$ (Also, the problem with zeros is when they are the expected not the observed counts as here.) $\endgroup$
    – usεr11852
    Commented Feb 24, 2023 at 12:46
  • $\begingroup$ I am not sure, but my understanding is that a multinomial test would need a predefined probability which is not what I want. From the data image, C attracted more participants; I want to know if that is significantly higher than the rest of the visualisations. $\endgroup$
    – London-35
    Commented Feb 24, 2023 at 13:06
  • 1
    $\begingroup$ But if we don't have a "predefined probability" how do we know that something is "significantly higher than the rest"? What is our H0 here? If all the images were "equally likely" to be looked that they should have a count of ~4. We suspect they don't so.... $\chi^2$! :) $\endgroup$
    – usεr11852
    Commented Feb 24, 2023 at 13:09
  • $\begingroup$ Ok, I understand now. Thank you! $\endgroup$
    – London-35
    Commented Feb 24, 2023 at 13:28

1 Answer 1

2
$\begingroup$

In general, this task to investigate if certain images are viewed first significantly more often than the rest can be approximated by a one-way $\chi^2$ test here. Our expected counts would be $4$ ($\frac{40}{10}$) if we assume that every image is equally likely to be picked. Then a $\chi^2$ test is fine provided we simulated the $p$-values because our expected counts are lower than $5$. So in terms of R we do something like this:

> S=c(5,4,11,2,0,5,6,0,3,4)
> set.seed(321)
> chisq.test(S, simulate.p.value=TRUE, B=2^17)

    Chi-squared test for given probabilities with simulated p-value (based
    on 131072 replicates)

data:  S
X-squared = 23, df = NA, p-value = 0.007164

Suggesting our $p$-value is below 1% so it is quite unlikely the observed counts came from a uniform distribution. One can use other test too (e.g. to run a multinomial test using XNomial::xmonte) but those give similar results.

> set.seed(321)
> XNomial::xmonte(S, rep(4,10), ntrials = 2^17, statName="LLR")

 P value (LLR) = 0.002662659 ± 0.0001423

> set.seed(321) 
> # Let's do a chi-squared test with this function too. 
> XNomial::xmonte(S, rep(4,10), ntrials = 2^17, statName="Chisq")

 P value (Chisq) = 0.007049561 ± 0.0002311

Of course if we had another null hypothesis about our expected counts we could use that instead and get the relevant results. Finally, let's note that that exact tests in this use-case would take too long as we have hundreds of millions of possible table combinations; I suppose they can be done if we are very eager though! :)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.