1
$\begingroup$

In this tutorial

https://learningstatisticswithr.com/book/chisquare.html

in Example 12.8.1 I understand the result of the test

## McNemar's chi-squared = 12.033, df = 1, p-value = 0.0005226

But they conclude:

And in fact, it looks like the ads had a negative effect: people were less likely to vote AGPP after seeing the ads

Why do they conclude that? How can we know if the effect of the ads (in this case) is positive or negative?

$\endgroup$
2
  • $\begingroup$ What are the counts of response_before for yes and response_after for no and yes? $\endgroup$ Commented Jan 30, 2021 at 12:31
  • $\begingroup$ response_before_yes_response_after_yes=5; response_before_yes_response_after_no=25; response_berfore_no_response_after_yes=5; response_before_no_response_after_no=65; therefore after the ads the response is 5 in both cases, there is no negative effect $\endgroup$
    – Ana
    Commented Jan 30, 2021 at 13:14

1 Answer 1

3
$\begingroup$

Your data should be something like this:

tab = as.table(rbind(c(65,5),c(25,5)))

colnames(tab) = c("no","yes")
rownames(tab) = c("no","yes")

names(dimnames(tab)) <- c("before", "after")
    
tab
      after
before no yes
   no  65   5
   yes 25   5

And the test goes:

mcnemar.test(tab)

    McNemar's Chi-squared test with continuity correction

data:  tab
McNemar's chi-squared = 12.033, df = 1, p-value = 0.0005226

You can interpret it as, before seeing the ad, 30% responded yes:

 rowSums(tab)
 no yes 
 70  30

After seeing the ad, only 10% responded yes:

colSums(tab)
 no yes 
 90  10 

Hence it has a negative effect.

$\endgroup$
0

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.