CochranQtest

Cochran's Q Test for Margins Homogeneity.
1.4K 次下载
更新时间 2004/12/3

查看许可证

This m-file performs the Cochran's Q test for multi-way tables which each variable has two levels, that is, for 2x2...x2 tables. It is used to test the homogeneity of the one-dimensional margins. So, Cochran's Q test is a nonparametric test examining change in a dichotomous variable across more than two observations. It can be approximate to a Chi-square statistic. When there are only two binary response variables, Cochran's Q test simplifies to McNemar's test. The test was proposed by Cochran (1950).

Then, for a NxK table where N is the number of subjects or blocks and K is the number of repeated measures or different tratments. The null hypothesis to test is,

Ho: p_1 = p_2 = . . . = p_K; j = 1,2,...,K.

p_j is the probability of a success for a case under condition/treatment j.

It needs to input X-data matrix (size of matrix must be N-by-K; binary value=column 1, treatment or repeated measure=column 2;subject or block=column 3), and alpha-significance level (default = 0.05).

The output is a table with the Cochran statistic, number of subjects or blocks, number of repeated mesures, degrees of freedom and upper-tail P-value.

引用格式

Antonio Trujillo-Ortiz (2025). CochranQtest (https://www.mathworks.com/matlabcentral/fileexchange/6431-cochranqtest), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R11
兼容任何版本
平台兼容性
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.0.0.0

Text was improved.