Presentation is loading. Please wait.

Presentation is loading. Please wait.

Contrasts Harry R. Erwin, PhD School of Computing and Technology University of Sunderland.

Similar presentations


Presentation on theme: "Contrasts Harry R. Erwin, PhD School of Computing and Technology University of Sunderland."— Presentation transcript:

1 Contrasts Harry R. Erwin, PhD School of Computing and Technology University of Sunderland

2 Resources Crawley, MJ (2005) Statistics: An Introduction Using R. Wiley. Freund, RJ, and WJ Wilson (1998) Regression Analysis, Academic Press. Gentle, JE (2002) Elements of Computational Statistics. Springer. Gonick, L., and Woollcott Smith (1993) A Cartoon Guide to Statistics. HarperResource (for fun).

3 Introduction Contrasts are the basis of hypothesis testing and model simplification in ANOVA When you have more than two levels in a categorical variable, you need to know which levels are meaningful and which can be combined. Sometimes you know which ones to combine and sometimes not. First do the ANOVA to determine whether there are significant differences to be investigated.

4 Orthogonal Contrasts For a factor with k levels, there are only k-1 orthogonal contrasts. (The missing one is used in the ANOVA testing to see if there is a significant difference.) The contrast coefficients form a vector in R k. The last of the k coefficients is constrained by the previous k-1. Any two contrasts are orthogonal in R k.

5 Example Suppose a factor has five levels: a, b, c, d, and e. d is the control level. a and b are similar treatments, as are c and e. Orthogonal contrast coefficients would be: –(1, 1, 1, -4, 1)—do the treatments contrast with the control? –(1, 1, -1, 0, -1)—do the different treatments contrast? –(1, -1, 0, 0, 0)—do the levels of the first treatment contrast? –(0, 0, 1, 0, -1)—do the levels of the second treatment contrast?

6 Model Reduction in ANOVA Basically how you reduce a model in ANOVA is by combining factor levels. Define your contrasts based on the science: –Treatment versus control –Similar treatments versus other treatments. –Treatment differences within similar treatments. You can also aggregate factor levels in steps. Book example.

7 Types of Contrasts Treatment contrasts (in R). Helmert contrasts (in S+) Sum contrasts (not used). Book example

8 Aliasing No information to analyse. Intrinsic aliasing reflects the structure of the model. (E.g., the model has more parameters than data points.) Extrinsic aliasing reflects the nature of the data. (E.g., missing data.) Book example.

9 ANCOVA and Contrasts Book example.


Download ppt "Contrasts Harry R. Erwin, PhD School of Computing and Technology University of Sunderland."

Similar presentations


Ads by Google