Diff for "FAQ/orthopolys" - CBU statistics Wiki
location: Diff for "FAQ/orthopolys"
Differences between revisions 15 and 16
Revision 15 as of 2020-02-10 13:29:17
Size: 1763
Editor: PeterWatson
Comment:
Revision 16 as of 2020-02-10 13:37:49
Size: 1813
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
Non-integer) contrast coefficients may be obtained in R using contr.poly(p) for a polynomial of degree p. Tables of polynomial contrast coefficients are also available in Biometrika tables which also give general formulae to obtain ''integer'' contrast coefficients for comparing upto 22 group means using polynomials upto degree 6. Non-integer orthogonal contrast coefficients may be obtained in R using contr.poly(p) for a polynomial of degree p. Tables of polynomial contrast coefficients are also available in Biometrika tables which also give general formulae to obtain ''integer'' contrast coefficients for comparing upto 22 group means using polynomials upto degree 6.
Line 11: Line 11:
Specific contrast coefficients can also be obtained assuming unequal distances between groups but the ratio of these differences must be specified e.g. if groups B and C are twice as far from each other as groups A and B then contrast coefficients may be obtained Specific orthogonal contrast coefficients can also be obtained assuming unequal distances between groups but the ratio of these differences must be specified e.g. if groups B and C are twice as far from each other as groups A and B then contrast coefficients may be obtained
Line 16: Line 16:
> poly(x,degree,1) > poly(x,degree)
Line 21: Line 21:
A pair of contrasts are said to be orthogonal if the sum of their paired contrast coefficients is zero (See page 184 of Everitt (1995)). A pair of contrasts are said to be orthogonal, or statistically independent, if the sum of their paired contrast coefficients is zero (See page 184 of Everitt (1995)).

Fitting linear orthogonal polynomials

A linear polynomial assumes that three or more groups have an ordering e.g. A>B>C and that the distances between each successive pair of groups are equal. This may be tested by specifying contrast coefficients in an anova.

Non-integer orthogonal contrast coefficients may be obtained in R using contr.poly(p) for a polynomial of degree p. Tables of polynomial contrast coefficients are also available in Biometrika tables which also give general formulae to obtain integer contrast coefficients for comparing upto 22 group means using polynomials upto degree 6.

contr.poly(4,contrasts=TRUE)

Specific orthogonal contrast coefficients can also be obtained assuming unequal distances between groups but the ratio of these differences must be specified e.g. if groups B and C are twice as far from each other as groups A and B then contrast coefficients may be obtained using, for example, R.

> x <- c(1,2,4)
> poly(x,degree)

If you suspect the groups are unequally spaced but do not know by how much then either fit a quadratic polynomial in addition to a linear one using a second set of contrast coefficients or use a nonparametric procedure such as Jonckheere's Trend Test.

A pair of contrasts are said to be orthogonal, or statistically independent, if the sum of their paired contrast coefficients is zero (See page 184 of Everitt (1995)).

References

Biometrika tables for Statisticians Volume 1 (1954) Edited by Pearson, ES and Hartley, HO. Cambridge University Press.

Everitt, B.S. (1995) The Cambridge Dictionary of Statistics in the Medical Sciences. Cambridge University Press.

None: FAQ/orthopolys (last edited 2020-02-11 16:12:26 by PeterWatson)