CochranQtest
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.
Zitieren als
Antonio Trujillo-Ortiz (2026). CochranQtest (https://de.mathworks.com/matlabcentral/fileexchange/6431-cochranqtest), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Plattform-Kompatibilität
Windows macOS LinuxKategorien
- AI and Statistics > Statistics and Machine Learning Toolbox > Probability Distributions and Hypothesis Tests > Hypothesis Tests >
Tags
Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.0.0.0 | Text was improved. |
