1 The future is a vain hope, the past is a distracting thought. Uphold our loving kindness at this instant, and be committed to our duties and responsibilities right now.
2 Applied Statistics Using SAS and SPSS Topic: Hypothesis Testing By Prof Kelly Fan, Cal State Univ, East Bay
3 Hypothesis Testing A statistical hypothesis is an assertion or conjecture concerning one or more populations. Agenda: 1.Types of tests 2.Types of errors 3.P-value 4.Summary of tests 5.Assumption checking
4
5
6 Types of Tests
7
8
9 Good! Good!(Correct!) H 0 trueH 0 false Type II Error, or “ Error” Type I Error, or “ Error” Good! Good!(Correct) we accept H 0 we reject H 0 Types of Errors
10 = Probability of Type I error = P(rej. H 0 |H 0 true) = Probability of Type II error = P(acc. H 0 |H 0 false) We often preset called significance level. The value of depends on the specifics of the H 1 (and most often in the real world, we don’t know these specifics).
11 C=14 1 EXAMPLE: H 0 : < 100 H 1 : >100 Suppose the Critical Value = 141: =100 X
12 = P (X < 141|H 0 false) 141 What is ? = P (X < 141/ = 150).3594 =.3594 = = P (X < 141/ = 160).2236 =.2236 = = P (X < 141/ = 170).1230 =.1230 = = P (X < 141/ = 180) = 180 These are values corresp.to a value of 25 for the Std. Dev. of X =.0594
13 Note: Had been preset at.025 (instead of.05), C would have been 149 (and would be larger); had been preset at.10, C would have been 132 and would be smaller. and “trade off”.
14 P Value Idea: The largest “risk” we pay to reject H0 (the observed type I error rate) (or the observed significance level) When will we reject Ho ? What is the formula to calculate the largest risk?
15 Steps of Hypothesis Tests 1.Set up Ho and Ha properly 2.Preset level (the significant level) 3.Select an appropriate test 4.Calculate its p-value 5.Reject Ho if p-value < or = the significant level; otherwise fail to reject Ho
16 Set Up Hypothesis Properly Conjecture: The fraction of defective product in a certain process is at most 10%. Which error is more seriously? Incorrectly claim this conjecture is true? false? The “=“ sign must be in Ho
17 One Population
18 Two Populations
19 Assumption Checking 1.Tests/graphs for normality 2.Tests for equal variances
20 Example: Mortar Strength The tension bond strength of cement mortar is an important characteristic of the product. An engineer is interested in comparing the strength of a modified formulation in which polymer latex emulsions have been added during mixing to the strength of the unmodified mortar. The experimenter has collected 10 observations on strength for the modified formulation and another 10 observations for the unmodified formulation.
21 Example: Mortar Strength ModifiedUnmodified
22 SAS/SPSS Data Input SPSS: One variable one column in the work sheet SAS: One variable one name
23 Normality Tests Tests for Normality Test --Statistic p Value Shapiro-Wilk W Pr < W Kolmogorov-Smirnov D Pr > D > Cramer-von Mises W-Sq Pr > W-Sq Anderson-Darling A-Sq Pr > A-Sq SAS: PROC UNIVARIATE DATA=** NORMAL PLOT;
24 Normality Tests SPSS: Analyze >> Descriptive Statistics >> Explore >> Plots, Normality plots with tests
25 Two-sample t Tests and Equal-variance Tests SAS: PROC TTEST DATA=** ;
26 SPSS: equal-variance tests: Homework for ST3900 students SPSS: two-sample t tests as below Two-sample t Tests and Equal-variance Tests
27 Research Question A researcher claims that a new series of math courses for elementary school is more effective than the current one. Two (1 st grade) classes of students are selected to perform an experiment to verify this claim. How would you conduct the experiment to avoid confounding variables as much as possible?
28 Paired Samples If the same set of sources are used to obtain data representing two populations, the two samples are called paired. The data might be paired: As a result of the data from certain “before” and “after” studies From matching two subjects to form “matched pairs”
29 Tests for Paired Samples Calculate the pair differences Proceed as in one sample case Notes: SAS: all variables must be included in data SPSS: create/calculate all variables we need
30 Review: Confidence Interval
31
32 One Population
33 Two Populations