ANOVA lecture notes outline

# ANOVA lecture notes outline - Notes on data analysis with R...

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Notes on data analysis with R and ANOVA Adam J. Rothman March 23, 2011 Contents 1 Data analysis with R 1 1.1 Loading datasets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Exploratory data analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2 An inference example with the two independent samples t-test 6 2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.2 Two independent samples t-tests . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2.1 Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2.2 Two sided alternative . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.2.3 Left sided alternative . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.2.4 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3 One-way ANOVA 11 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.2 The one-way ANOVA Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.3 Hypothesis testing for ANOVA . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.3.2 Assumptions, Formula, and Interpretation . . . . . . . . . . . . . . . 14 3.3.3 Data example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.3.4 Simultaneous pairwise comparisons . . . . . . . . . . . . . . . . . . . 17 3.4 Chicken example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 1 Data analysis with R Datasets usually consist of several characteristics measured for n subjects/units. These characteristics may be numerical or categorical. Definition: numerical characteristic a characteristic that takes on numerical values for which arithmetic operations make sense. (e.g. height, number of children, etc.) 1 Definition: categorical characteristic a characteristic that takes on one of a set of levels/categories. (e.g. the characteristic political party affiliation with levels { democrat, republican, other } . A categorical characteristic is sometimes called a “factor”. Sometimes the levels of categorical characteristics are coded with numbers. For example, some datasets may code “gender” with “1” for male and “2” for female. 1.1 Loading datasets If a dataset is available in a text file, it can be loaded with the read.table() command. This command has several arguments, some of which may need to be set to account for how the data is arranged in the text file. To see a description of these arguments, type help(read.table) . The text file we wish to load must be in R ’s working directory. To change this directory in Windows/Macintosh, use the menu “FILE- > Change DIR”. One could also use getwd() and setwd() to get and set the working directory for R ....
View Full Document

{[ snackBarMessage ]}

### Page1 / 22

ANOVA lecture notes outline - Notes on data analysis with R...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online