Hello to everyone,
I think I have an answer to Prof. Martin Blands question. Maybe it is of
general interest, or should be discussed. That's why I post it to the
list:
> If we have a cohort of subjects and ask them a yes/no question on
> several occasions, how can we test the null hypothesis that the
> proportion of "yes"s is constant?
>
> If there were two occasions, we could do this with McNemar's test
(sign
> test). But how do we do it with more that two occasions?
To check if I have understood correctly: r subjects are asked several
questions; for generality, the number of questions may vary and be
denoted
n_i for the i-th subject (i=1...r). The number of yes-answers of subject
i
may be denoted as f_i. Then the question is, if the probability of
yes-answers is independent of the subject.
I would choose a resampling test (bootstrap-like approach): Given the
null
hypothesis. Then the aforesaid probability p can be estimated as
p := sum(i=1...r) f_i / n, with n = sum(i=1...r)
As a test quantity I would choose the standard deviation
t := sum(1=1...r) (f_i - n_i p)^2 / (n-1).
The value of t for the given samples be denoted as t_obs. The
distribution
of t can be calculated as follows:
choose nb=400
for b=1...nb {
for i=1...r {
create a sample x1...xm, of size n_i, by assigning to each of
the
x_j the value 1 with a probability p, and 0 else;
count the number of x_j with value 1 and denote it as k_i
}
calculate the value of the test quantity t and denote it as t_b
}
count the number of t_b >= t_obs and divide it by nb and denote the
result
as alpha_nb
Then alpha_nb is an estimate for the p-value (significance). Check for
convergence by varying nb (say, between 100 and 1000). It may be useful
to
define the final estimate for the significance by
alpha := sum(nb) nb alpha_nb / sum(nb) nb.
Could that make sense?
Kind regards,
Volker Knecht
|