"There are three kinds of lies: lies, damned lies, and statistics." - Charles Wentworth Dilke (1843–1911).

# Math 263 Fall 2011

## Introduction to Statistics and Biostatistics

### Announcements

• Review Session for the Final Exam:
• Location: Math 501
• Date: Tuesday, December 13, 2011
• Time: from 5pm to 6:30pm.
• Here is a new final info. It has a link to Chapter 9 and 12 practice problems.
• Rules of newly announced extra credit are here.
• An updated list of R resources is at the bottom of the page, including tutorials and refcards ("cheat sheets").
• You will find Chapter 9 materials here. There is a PDF file showing step-by-step how to conduct a chi-square test. Also, there are R examples (in the R subfolder) which contain real scripts I used to solve some of the Chapter 9 WebAssign problems. You will also find the output I generated today by running R in class. If you use Excel for solving Chapter 9 WebAssign homework, you can still benefit by using the outer product operator (%o%) which you can call from R commander after you move some data to R.

You may use "Put R variable" this time to transfer data to R; if you transfer data using "Put R data frame", make sure to include table headings in the transfer, so that data have names, say "x" and "y". If the frame is called "aframe", you can access individual columns by using variable names "aframe\$x", "aframe\$y". Alternatively, you can use

`attach(frame)`
after which R makes the variables named "x" and "y", which stand for the columns of the data frame.

• Excel/R Assignment 6 is now available here.
• Excel/R (this time pure R!) Assignment 5 is now available here.
• There is a big practice test (over 50 problems) for Midterm 3 and the Final Exam. The answers to the practice test WILL NOT be posted.

### Excel Assignments

Please turn in Excel assignments as hard copy, with every sheet bearing your name, before class on the due day.

#### Assignment 2.5 - due September 26

Please refer to Assignment #2 for the dataset.

#### Assignment 3 - due October 24

Please refer to Assignment #2 for the dataset.

#### Assignment 4 - due November 14

Two last assignments below are extra credit. You may turn it in to the Math Office (Math 108) if you do it after December 5 and not during my office hours.

### Chapter 6

Notes related to Chapter 6 are here:

### Chapter 7

Notes related to Chapter 7 are here:

### Midterm 3

• Midterm 3 Information - updated for Fall 2011

### Chapter 7 - the two-sample t-test

• Wikipedia article on the Welch's test with the Welch-Satterthwaite formula for the number of degrees of freedom. Note that this is the test described in the book and implemented by the R function t.test, for the situation when sample sizes are uneven and we have no reason to believe that the two populations have identical variances.
• An excellent Wikipedia summary of several variants of the t-test used for a number of distinct situations (such as two-sample test when the variances of both populations are believed to be the same).
• A two-sample t-test in R for the example presented in class:
• An R example

### Chapter 9 - the chi-square test and two-way tables

• An R example
• A PDF with a chi-squared test.
• Another site illustrating using R for chi-squared test for two-way tables. The example uses a file with heart attack data which can be found here (please note that you will find there a number of other useful R examples). The particular file that needs to be read is Here is a local mirror of this site.
• An example of how to run the scripts and read data with R.

### Chapter 12 - one-way ANOVA

• R examples
• A nice example of one-way ANOVA with boxplots and linear model fitting. Also, illustrates working with lists ('sapply') and splitting data by levels of a factor ('split').
• An R example of one-way ANOVA with pairwise t-test (no data appears to be available, just the sequence of R commands).
• A very cojent explanation of 2-way ANOVA.

## More R resources

### The final

• The Final Information - partially updated for Fall 2011