szcf-weiya / ESL-CN

The Elements of Statistical Learning (ESL)的中文翻译、代码实现及其习题解答。
https://esl.hohoweiya.xyz
GNU General Public License v3.0
2.39k stars 588 forks source link

Ex. 10.6 #214

Closed szcf-weiya closed 4 years ago

szcf-weiya commented 4 years ago

image

szcf-weiya commented 4 years ago

image

szcf-weiya commented 4 years ago

Actually, I think the description of the question (b) is confusing since McNemar Test is only available for two-sided. More discussion in One-sided McNemar's test

szcf-weiya commented 4 years ago

By the way, it is quite easy to conduct a McNemar's Test in R.

> mcnemar.test(matrix(c(1434, 18, 33, 51), nrow=2, byrow=T), correct=FALSE)

    McNemar's Chi-squared test

data:  matrix(c(1434, 18, 33, 51), nrow = 2, byrow = T)
McNemar's chi-squared = 4.4118, df = 1, p-value = 0.03569

> mcnemar.test(matrix(c(1434, 18, 33, 51), nrow=2, byrow=T), correct=TRUE)

    McNemar's Chi-squared test with continuity correction

data:  matrix(c(1434, 18, 33, 51), nrow = 2, byrow = T)
McNemar's chi-squared = 3.8431, df = 1, p-value = 0.04995