Fall Exam • What is in the exam: – Chapters 1-9 – Lecture Slides 01-08 (up to and including Linear Regression) – Assignments 1-2 PSYC 6130, PROF. J. ELDER 1 Fall Term Material Descriptive Statistics • • Basics – Scales of measurement – Means, medians, modes – Continuous vs. discrete variables – Standard deviations, SQI, range – Independent and dependent variables – Skewness, kurtosis – Experimental vs. correlational research • – Populations vs. samples – Z scores Tables and Graphs – SEM – f, cf, rf, crf, cpf – Central Limit Theorem – Grouped frequency distributions – Apparent vs real limits – Percentiles, percentile ranks, linear interpolation PSYC 6130, PROF. J. ELDER The Normal Distribution – Probability rules – Summation notation • Central Tendency and Variability 3 Inferential Statistics: Hypothesis Tests of the Mean – Introduction to NHT – Type I and Type II errors – One-tailed vs two-tailed tests – 6-step procedure – One-sample z test – One-sample t test – t Test for two independent sample means – Homogeneity of variance – The Matched t Test – Going beyond null hypothesis testing – Planning experiments (power) – Effect size – Confidence intervals PSYC 6130, PROF. J. ELDER 4 Correlation and Regression – Pearson’s r – Significance and power for Pearson’s r – Fisher Transform – Regression formulae – Explained and unexplained variance – Coefficients of determination, non-determination – Homoscedasticity – Confidence intervals for predictions – Partialing out PSYC 6130, PROF. J. ELDER 5 Some Important Topics Basic Procedure for Statistical Inference 1. State the hypothesis 2. Select the statistical test and significance level 3. Select the sample and collect the data 4. Find the region of rejection 5. Calculate the test statistic 6. Make the statistical decision PSYC 6130, PROF. J. ELDER 7 NHT for Two Small Independent Samples By analogy with one-sample NHT, we might approximate the standard errors X1 and X2 by the sample standard errors s X1 and s X2 . Unfortunately, the resulting sampling distribution of the difference of the means is not straightforward to analyze. So what do we do? If we can assume homogeneity of variance (the two populations have the same variance), then there is a statistic that follows the t distribution and is simple to analyze. PSYC 6130, PROF. J. ELDER 8 Pooled Variance Pooled variance is s 2 p n1 1 s12 n2 1 s22 n1 1 n2 1 df1s12 df2s22 df1 df2 Note that the pooled variance is a weighted sum of the sample variances. The weights are proportional to the size of each sample (Bigger samples are more reliable estimators of the common variance) df2 df1 sp2 s12 PSYC 6130, PROF. J. ELDER 9 s22 Summary: t-Tests for 2 Independent Sample Means n1, n2 100 n1 s2 Test n2 s1 statistic s X2 1 X2 df t s12 s22 n1 n2 WelchSatterthwaite t sp2 n1 n2 2 n1 sp2 n2 t s12 s22 n1 n2 n1 n2 2 t s12 s22 n1 n2 n1 n2 2 z s12 s22 n1 n2 NA z s12 s22 n1 n2 NA z s12 s22 n1 n2 NA z s12 s22 n1 n2 NA PSYC 6130, PROF. J. ELDER 10 Separate Variances t Test • If – Population variances are different (suggested by substantially different sample variances) AND – Samples are small AND – Sample sizes are substantially different • Then – Pooled variance t statistic will not be correct. • In this case, use separate variances t test PSYC 6130, PROF. J. ELDER 11 Separate Variances t Test X t 1 X 2 1 2 s X1 X2 where sX2 1 X2 sX2 1 sX2 2 • This t statistic is well approximated by a t distribution. • Unfortunately, calculating the appropriate df is difficult. • SPSS will calculate the Welch-Satterthwaite approximation for df as part of a 2-sample t test: s df 2 X1 s X4 1 df1 s 2 X2 2 s X4 2 df2 PSYC 6130, PROF. J. ELDER 12 More on Homogeneity of Variance • How do we decide if two sample variances are different enough to suggest different population variances? • Need NHT for homogeneity of variance. – F-test • Straightforward • Sensitive to deviations from normality – Levene’s test • More robust to deviations from normality • Computed by SPSS PSYC 6130, PROF. J. ELDER 13 Levene’s Test: Basic Idea 1. Replace each score X1i , X2i with its absolute deviation from the sample mean: d1i | X1i X1 | d 2i | X 2i X 2 | 2. Now run an independent samples t-test on d1i and d2i : t d1 d 2 sd1 d2 SPSS reports an F-statistic for Levene’s test • Allows the homogeneity of variance for two or more variables to be tested. • We will cover the F distribution in the winter term. PSYC 6130, PROF. J. ELDER 14 Independent or Matched? • Application of the Independent-Groups t test depended on independence both within and between groups. • There are many cases where it is wise, convenient or necessary to use a matched design, in which there is a 1:1 correspondence between scores in the two samples. • In this case, you cannot assume independence between samples! • Examples: – Repeated-subject designs (same subjects in both samples). – Matched-pairs designs (attempt to match possibly important attributes of subjects in two samples) PSYC 6130, PROF. J. ELDER 15 Better alternative: The matched t-test using the direct difference method A3 A4 A4-A3 72 80 70 80 69 93 83 88 88 93 88 93 87 88 88 93 85 100 85 100 70 80 72 90 60 80 83 75 81 83 68 75 36 93 80 100 65 83 65 83 41 75 73 88 68 75 Mean SD n 8 10 24 5 5 5 1 5 15 15 10 18 20 -8 2 7 57 20 18 18 34 15 7 73 86 13 14 23 8 23 13 23 PSYC 6130, PROF. J. ELDER t X 0 s/ n t 16 D 0 sD / n Limitations of NHT • Criticisms of NHT date from the 1930s. – Null hypothesis is rarely true. – The real question is not about the existence of an effect, but about the nature of the effect: • What is the direction of the effect? • What is the size of the effect? • How important is it? • What are the underlying mechanisms (theory)? PSYC 6130, PROF. J. ELDER 17 Magnitude of Effect • A problem with a point estimate is that it suggests a certainty we do not really have. • A more complete and useful description of the magnitude of the effect is provided by a confidence interval. e.g., s X1 X2 2.632 2.852 0.044" 7586 7777 The 95% confidence interval for 1 -2 X1 X 2 z /2s X1 X2 , X1 X 2 z /2s X1 X2 X 69.87 " s 2.63 " n 7586 0.86" 1.96 0.044",0.86" 1.96 0.044" [0.77",0.95"] X 69.01" s 2.85 " n 7777 PSYC 6130, PROF. J. ELDER 18 Importance of Effect • However it is often more meaningful to compare the treatment effect to the overall variation in the measured variable: d X 69.87 " s 2.63 " n 7586 1 2 X1 X 2 sp df1s12 df2s22 where s df1 df2 2 p 7585 2.632 7776 2.85 2 7585 7776 7.53 X 69.01" s 2.85 " n 7777 Thus sp 2.74" d PSYC 6130, PROF. J. ELDER 19 0.86 " 0.31 2.74 " Example Effect Sizes 0.4 Group 1 0.4 Group 2 0.2 0 -5 0.4 0.2 0 d=.5 0.4 0.2 0 -5 PSYC 6130, PROF. J. ELDER 0 -5 5 0 d=1 5 0 d=4 5 0.2 0 d=2 0 -5 5 20 Planning a Study • There are many considerations that go into planning an experiment or study. • Here we focus on the statistical considerations. • Some possible questions: – How many samples (e.g., subjects) will I need for my study? – I already know that I will only have access to n samples (subjects). Will this be enough? • Answering these questions depends on understanding the relationship between sample size, effect size, and statistical power. PSYC 6130, PROF. J. ELDER 21 Standardized Distributions of the Difference of the Means NHD AHD 0.4 Probability p(t) 0.3 Power 1 0.2 1 0.1 0 -4 -2 0 E[t | H0 ] 2 tcrit t PSYC 6130, PROF. J. ELDER 22 4 n d 2 6 8 Estimating Power If we have an estimate of the expected t value , we can estimate the power 1 Pr(t tcrit | E[t ] 0) (Non-central t distribution) (Central t distribution) Pr(t) Pr(t) 1 Pr(t tcrit | E[t ] ) tcrit 1 1 tcrit 0 Expected t value PSYC 6130, PROF. J. ELDER 23 Calculating Power from Sample Size and Effect Size - tcrit Sample size n + E [t ] Effect Size d + PSYC 6130, PROF. J. ELDER n d 2 24 + Power 1 Planning Experiments • Planning experiments may involve estimating any one of these variables given knowledge or assumptions about the other two: n, d power: n d 2 You have already decided on the size of your sample, and you have an estimate of the effect size. What is the power of your experiment? d, power n : n 2 d 2 You have an estimate of the effect size, and know the minimum power you want. What sample size do you need? n, power d : d 2 n You have already decided on the size of your sample, and you know the power you want. What does the size of the effect have to be to give you this power? PSYC 6130, PROF. J. ELDER 25 Correlation Standard Definition of Correlation (Sample) Recall that the sample variance sX2 of X is s E X X 2 X 2 1 XX n 1 2 We define the sample covariance sXY of X and Y as 1 s XY E X X Y Y X X Y Y n 1 The Pearson correlation r between X and Y is then given by r s XY s X sY PSYC 6130, PROF. J. ELDER 27 Computational Formula covariance For a population: For a sample: z z x N y ( X x )(Y y ) N x y XY N 1 zx zy ( X X )(Y Y ) N 1 r N 1 (N 1)sx sy unbiased covariance PSYC 6130, PROF. J. ELDER 28 x y x y XY NXY s x sy