|
IDL Analyst Reference Guide: Nonparametric Statistics |
|
The IMSL_COCHRANQ function performs a Cochran Q test for related observations.
| Note This routine requires an IDL Analyst license. For more information, contact your ITT Visual Information Solutions sales or technical support representative. |
Result = IMSL_COCHRANQ(x [, /DOUBLE] [, Q=variable])
The p-value for the Cochran Q statistic.
Two-dimensional array containing the matrix of dichotomized data.
If present and nonzero, double precision is used.
Named variable into which the Cochran's Q statistic is stored.
The IMSL_COCHRANQ function computes the Cochran Q test statistic that may be used to determine whether or not M matched sets of responses differ significantly among themselves. The data may be thought of as arising out of a randomized block design in which the outcome variable must be success or failure, coded as 1.0 and 0.0, respectively. Within each block, a multivariate vector of 1's of 0's is observed. The hypothesis is that the probability of success within a block does not depend upon the treatment.
The hypothesis being tested may be stated in at least two ways.
The null hypothesis is rejected if Cochrans's Q statistic is too large.
The following example is taken from Siegal (1956, p. 164). It measures the responses of 18 women to 3 types of interviews.
x = TRANSPOSE([[0.0, 0.0, 0.0], [1.0, 1.0, 0.0], $ [0.0, 1.0, 0.0], [0.0, 0.0, 0.0], $ [1.0, 0.0, 0.0], [1.0, 1.0, 0.0], $ [1.0, 1.0, 0.0], [0.0, 1.0, 0.0], $ [1.0, 0.0, 0.0], [0.0, 0.0, 0.0], $ [1.0, 1.0, 1.0], [1.0, 1.0, 1.0], $ [1.0, 1.0, 0.0], [1.0, 1.0, 0.0], $ [1.0, 1.0, 0.0], [1.0, 1.0, 1.0], $ [1.0, 1.0, 0.0], [1.0, 1.0, 0.0]]) pq = IMSL_COCHRANQ(x) PRINT, 'pq =', pq pq = 0.000240266
STAT_ALL_0_OR_1—"x" consists of either all ones or all zeros. "q" is set to NaN (not a number). "Result" is set to 1.0.
STAT_INVALID_X_VALUES—"x(#, #)" = #. "x" must consist of zeros and ones only.
IDL Online Help (March 06, 2007)