McNemarextest

McNemar's Exact Test.
2.5K 次下载
更新时间 2009/10/23

查看许可证

This m-file performs the conditional as well as the Chi-squared corrected for discontinuity McNemar's exact test for two dependent (correlated) samples that can occur in matched-pair studies with a dichotomous (yes-no) response. Dependent samples can also occur when the same subject is measured at two different times. It tests the null hypothesis of marginal homogeneity. This implies that rows totals are equal to the corresponding column totals. So, since the a- and the d-value on both sides of the equations cancel, then b = c. This is the basis of the proposed test by McNemar (1947). The McNemar test tests the null hypothesis that conditional on b + c, b has a binomial (b + c, 1/2) distribution.

The proper way to test the null hypothesis is to apply the one-sample binomial test. If there is no association between b and c values, then the probability is 0.5 that the sample 1 and sample 2 pair falls in the
upper-right cell and 0.5 that it falls in the lower-left cell, given that the pair falls off the main diagonal.

File needs to input data vector defined by the observed frequency cells [a,b,c,d], desired test [t = 1, one-tail; t = 2, two-tail (default)], and significance level (default = 0.05).

It outputs a table with the proportion of success for the dependent samples and the P-value.

引用格式

Antonio Trujillo-Ortiz (2024). McNemarextest (https://www.mathworks.com/matlabcentral/fileexchange/6297-mcnemarextest), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R14
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Hypothesis Tests 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.5.0.0

Text was improved.

1.1.0.0

The file was modified to perform also a Chi-squared test corrected by discontinuity, besides the original conditioned one.

1.0.0.0

Text was improved.