Diff for "FAQ/polybs" - CBU statistics Wiki
location: Diff for "FAQ/polybs"
Differences between revisions 17 and 18
Revision 17 as of 2011-11-23 13:43:17
Size: 3974
Editor: PeterWatson
Comment:
Revision 18 as of 2011-11-23 13:46:09
Size: 4174
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 25: Line 25:
The unweighted ANOVA using the polynomial=1 subcommand gives the ANOVA equivalent of the t-test for unweighted results. The sums of squares in the ANOVA are obtained by multiplying the numerator and denominator in the t-test by the sum of the reciprocal groups sizes of the first and third group and squaring the result ie giving SS(linear contrast)= (1/3+1/4)[0.5(2.333-2.5)]^2 / (1/3+1/4) and SS(error term) = MSE. The unweighted ANOVA using the polynomial=1 subcommand gives the ANOVA equivalent of the t-test for unweighted results. The sums of squares (SS) in the outputted ANOVA are obtained by multiplying the numerator and denominator in the t-test (using 1 0 -1 input just described) by the sum of the reciprocal groups sizes of the first and third group (which have non-zero contrast coefficients in the test of linear trend) and squaring the result ie giving SS(linear contrast)= (1/3+1/4)[0.5(2.333-2.5)]^2 / (1/3+1/4) and SS(error term) = MSE so the F ratio is simply the squar eof the t-ratio with an identical p-value.

How do I test for a trend between group means representing different subjects?

Let us suppose we wish to test for a linear trend between between subjects group means. This can be done using polynomial coefficients

ONEWAY
  OUTCOME BY GROUP
  /POLYNOMIAL= 1
  /MISSING ANALYSIS .

In the case of unequal group sizes SPSS produces two outputs called weighted and unweighted sums of squares. The weighted sums of squares assumes group sizes are important for example to reflect relative sizes of each group in the general population. Unweighted sums of squares ignore differences in group sizes and compares group means using the same average group size for each group so each group contributes equally to the trend analysis. The unweighted results may also be obtained running a trend test using contrast coefficients as below.

ONEWAY
  correct BY priming
  /CONTRAST= 1 0 -1
  /MISSING ANALYSIS .

Using the contrast coefficient, 1, 0 -1, gives the equivalent unweighted result corresponding to a t-test on N-k degrees of freedom of the contrast divides 0.5(mean1 - mean3) by its standard error. The standard error of the contrast is given by $$\sqrt{MSE\sum_text{i}\frac{c_text{i}^text{2}}{n_text{i}}}$$ where $$c_text{i}$$ is the i-th contrast coefficient for the i-th mean based on a sample size of $$n_{i}$$ for each of k groups.

To illustrate the use of unweighted means suppose we have three group means 2.333, 2.00 and 2.50 with respective group sizes 3, 4 and 4 and we wish to see if there is a linear trend. In the above example the unweighted t-test for linear trend on (40-4) df = 0.5(2.333-2.5) / sqrt(MSE (1/3 + 1/4) ) = sqrt(2.139 [0.583]) = 1.335 giving a t(36) = -0.084/1.335 = -0.063. MSE is the Mean Square Error term from the usual between subjects group one-way ANOVA.

The unweighted ANOVA using the polynomial=1 subcommand gives the ANOVA equivalent of the t-test for unweighted results. The sums of squares (SS) in the outputted ANOVA are obtained by multiplying the numerator and denominator in the t-test (using 1 0 -1 input just described) by the sum of the reciprocal groups sizes of the first and third group (which have non-zero contrast coefficients in the test of linear trend) and squaring the result ie giving SS(linear contrast)= (1/3+1/4)[0.5(2.333-2.5)]^2 / (1/3+1/4) and SS(error term) = MSE so the F ratio is simply the squar eof the t-ratio with an identical p-value.

Using the polynomial coefficients this is akin to using a contrast to test if there is a difference between the first and third group means. From Boniface (1995)

SS(linear contrast) = Harmonic mean x (difference in first and third group means $$\text^2$$)/ (sum of the squares of the contrast coefficients) where

$$ \mbox{Harmonic mean} = \frac{3}{\frac{1}{3} + \frac{1}{4} + \frac{1}{4}} = 3.6.$$

Unweighted SS(linear contrast) = 3.6 (2.333-2.5)(2.333-2.5)/(1 + 1) = 0.050.

The SS(error) which is divided into SS(contrast) to give a F ratio is equal to SQRT[ SUM OF SQUARES OF CONTRAST COEFFS X MSE/N PER GROUP] = SQRT [ (32 + 12 + 12 + 12) 2.139/10 = 1.60.

For further discussion on the differences between weighted and unweighted analyses see the first half of Amy Shelton's excellent on-line tutorial given in a pdf file which can be accessed from [attachment:weights.pdf here.]

Note that linear and higher order trend tests are performed by SPSS in repeated measures ANOVA by default using the GLM procedure (see Post-hoc Grad talk for further details [http://imaging.mrc-cbu.cam.ac.uk/statswiki/StatsCourse2010 here]). Trend tests may be carried out without a significant overall F as it looks at a specific relationship between group means which is not tested by the overall F test in the ANOVA. Trend tests are usually planned (apriori) comparisons. A further explanation about the difference between a group trend and an overall group comparison is given [:FAQ/ltrend: here.]

Reference

Boniface DR (1995) Experiment design and statistical methods for behavioural and social research. Chapman and Hall:London. This book is available in the CBU library.

None: FAQ/polybs (last edited 2015-02-02 12:54:57 by PeterWatson)