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
Unformatted text preview: Psychology 205: Spring, 2010 Problem Set 1  Solutions William Revelle Contents 1 Introduction to using R for statistics 1 2 Comparing two groups 2 2.1 A sample problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2.2 Review of variability of distributions of samples . . . . . . . . . . . . . . . . . . . . . 2 2.3 The ttest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.4 Using R to do ttests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.4.1 ANOVA as a generalized ttest. . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.4.2 Linear regression as a generalized ANOVA . . . . . . . . . . . . . . . . . . . . 7 3 Linear regression and correlation 10 4 Two way Analysis of Variance 12 5 Chi Square tests of independence 14 6 Correlated and uncorrelated ttests 15 6.1 Uncorrelated ttests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 6.2 Correlated ttests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 7 Using the normal distribution 17 8 The binomial distribution 17 1 Introduction to using R for statistics Problem set 1 asked for a variety of analyses. Here I show the direct answers, but also do the analyses in a variety of ways. I use the statistical program R . For help on R , go to the short tutorial on using R for research methods http://personalityproject.org/r/r.205.tutorial.html . In the following, I assume that you have downloaded R and installed the psych package. 1 2 Comparing two groups 2.1 A sample problem An investigator believes that caffeine facilitates performance on a simple spelling test. Two groups of subjects are given either 200 mg of caffeine or a placebo. Although there are several ways of testing if these two groups differ, the most conventional would be a ttest. Apply a ttest to the data in Table 1: Table 1: The effect of caffeine on spelling performance placebo caffeine 24 24 25 29 27 26 26 23 26 25 22 28 21 27 22 24 23 27 25 28 25 27 25 26 2.2 Review of variability of distributions of samples Many statistical tests may be thought of as comparing a statistic to the error of the statistic. One of the most used tests, the ttest (developed by Gossett but published under the name of Student), compares the difference between two means to the expected error of the difference between the means. As we know, the standard error (se) of a single group with mean, X with standard deviation, s , and variance, s 2 s 2 = n i =1 ( X i X ) 2 n 1 (1) is just s.e. = r s 2 n = s n . (2) The standard error of a mean is just the standard deviation of the mean and depends upon the standard deviation of the individual measures as well as the number of observations that went into the mean. As the sample size grows larger, the standard error tends to be distributed as a normal distribution, but for small samples, the standard error follows a t distribution ....
View
Full
Document
This note was uploaded on 10/11/2011 for the course PSYCH 205 taught by Professor Smith during the Spring '09 term at Northwestern.
 Spring '09
 SMITH
 Psychology

Click to edit the document details