------------------------------------------------------------------------------- help forcochran-------------------------------------------------------------------------------

Test for equality of proportions in matched samples (Cochran's Q)

cochranvarlist[weight] [ifexp] [inrange] [,detail]

by...:may be used withcochran; see help by.

fweights are allowed withcochran; see help weights.

Description

cochranperforms a test for equality of two or more proportions in matched samples: Taking the 1-to-1 matching of observations into account,cochrantests that the proportion of nonzero outcomes is constant for the variables invarlist.The chi-squared calculated by

cochranis known as Cochran's Q (Cochran 1950). If only two proportions are compared, Cochran's Q is equal to the McNemar chi-squared calculated by mcc. An exact significance probability will be reported in this case.

Options

detailspecifies to display the proportions and counts (i.e. number of nonzero outcomes).

Saved ResultsScalars:

r(N)number of casesr(chi2)Cochran's Qr(df)degrees of freedomr(p)p-valuer(p_exact)exact p-value (if only two proportions are compared)Matrices:

r(T)proportions and counts

Methods and FormulasCochran's Q is defined as

c* (c-1) * sum_j(T_j-T_bar)^2Q= -------------------------------------c* sum_i(u_i) - sum_i(u_i^2 )where

cis the number columns (= number of proportions = number of variables),T_jis the number of nonzero outcomes in thejth column,T_baris the mean number of nonzero outcomes (i.e. the proportion of nonzero outcomes) per column, andu_iis the number of nonzero outcomes in theith row (= number of nonzero outcomes in theith observarion).For large samples,

Qis chi-square distributed with (c-1) degrees of freedom.

ReferenceCochran, W. G. 1950. The Comparison of Percentages in Matched Samples.

Biometrika37(3/4): 256-266.

AuthorBen Jann, ETH Zurich, jann@soz.gess.ethz.ch

Also see