Code covered by the BSD License  

Highlights from
CochranQtest

Be the first to rate this file! 0 Downloads (last 30 days) File Size: 3.12 KB File ID: #6431

CochranQtest

by Antonio Trujillo-Ortiz

 

30 Nov 2004 (Updated 03 Dec 2004)

Cochran's Q Test for Margins Homogeneity.

| Watch this File

File Information
Description

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.

MATLAB release MATLAB 5.3 (R11)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
03 Dec 2004

It was added an appropriate format to cite this file.

03 Dec 2004

Text was improved.

Tag Activity for this File
Tag Applied By Date/Time
statistics Antonio Trujillo-Ortiz 22 Oct 2008 07:36:53
probability Antonio Trujillo-Ortiz 22 Oct 2008 07:36:53
cochran Antonio Trujillo-Ortiz 22 Oct 2008 07:36:53
q test Antonio Trujillo-Ortiz 22 Oct 2008 07:36:53
homogeneity Antonio Trujillo-Ortiz 22 Oct 2008 07:36:53
margins Antonio Trujillo-Ortiz 22 Oct 2008 07:36:53
binary Antonio Trujillo-Ortiz 22 Oct 2008 07:36:53

Contact us at files@mathworks.com