Calculates the Cochran-Armitage chi-square test for trend (A.I. Glaser).
|Output required (
||Table containing observed data|
||Dimension of the table representing the trend; can default if only one dimension of size greater than 2|
||Saves the chi-square for trend|
||Saves the probability value for trend|
||Saves the chi-square for deviations from a linear trend|
||Saves the degrees of freedom for the chi-square for deviations|
||Saves the probability value for the chi-square for deviations|
CATRENDTEST procedure calculates the Cochran-Armitage chi-square test for trend. Categorical data can be collected and categorized by explanatory factors (such as dosage or treatment level), and any analysis will try to indicate relationships between the response (binary) factor and explanatory factors. The Cochran-Armitage chi-square test calculates a chi-square statistic on 1 degree of freedom for a linear trend in the responses. The data are represented by a (2×K or K×2) contingency table, where K represents the explanatory factor (known as the trend).
DATA parameter supplies the data values in a two-way table. The
TREND parameter can be set to a factor to indicate which dimension of the table represents the trend; if this is omitted
CATRENDTEST assumes that the trend is in the dimension with more than 2 rows or columns (the other dimension must have exactly 2 rows or columns).
CATRENDTEST prints the results of tests for trend and for deviation from a trend (chi-square values, degrees of freedom and probabilities), but you can suppress these by setting option
DEVPROBABILITY allow the results to be saved (in scalars).
The method is described in Section 15.2 of Armitage, Berry & Matthews (1994).
Armitage, P., Berry, G. & Matthews, J.N.S. (1994). Statistical Methods in Medical Research. Blackwell Science, Oxford.
CAPTION 'CATRENDTEST example',\ 'Data from Table 15.1 of Armitage, Berry & Matthews (1994)';\ STYLE=meta,plain FACTOR [LEVELS=2; LABELS=!T('Yes','No')] Attendence FACTOR [LEVELS=!(0,1,2,3)] Score TABLE [CLASS=Score,Attendence; VALUES=59,97,10,31,12,36,5,28] Patient CATRENDTEST Patient; TREND=Score