1 the future is a vain hope, the past is a distracting thought. uphold our loving kindness at this...
TRANSCRIPT
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
9
Good!Good!(Correct!)(Correct!)
H0 true H0 false
Type II Type II Error, or Error, or ““ Error” Error”
Type I Type I Error, or Error, or ““ Error” Error”
Good!Good!(Correct)(Correct)
we accept H0
we reject H0
Types of Errors
10
= Probability of Type I error = P(rej. H0|H0 true)
= Probability of Type II error= P(acc. H0|H0 false)
We often preset called significance level. The value of depends on the specifics of the H1 (and most often in the real world, we don’t know these specifics).
12 = P (X < 141|H0 false)
141What is ?
= P (X < 141/= 150)= .3594.3594
= 150
= 150
141
= P (X < 141/= 160)= .2236.2236
= 160
= 160
141
= P (X < 141/= 170)= .1230.1230
= 170
= 170
141
= P (X < 141/= 180)
= 180
= 180
These are values
corresp.to a value of 25 for the Std. Dev. of X
= .0594= .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
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
16.85 17.5016.40 17.6317.21 18.2516.35 18.0016.52 17.8617.04 17.7516.96 18.2217.15 17.9016.59 17.9616.57 18.15
23
Normality Tests
Tests for Normality
Test --Statistic--- -----p Value------
Shapiro-Wilk W 0.918255 Pr < W 0.0917Kolmogorov-Smirnov D 0.134926 Pr > D >0.1500Cramer-von Mises W-Sq 0.081542 Pr > W-Sq 0.1936Anderson-Darling A-Sq 0.537514 Pr > A-Sq 0.1503
SAS: PROC UNIVARIATE DATA=** NORMAL PLOT;
24
Normality Tests
SPSS: Analyze >> Descriptive Statistics >> Explore >> Plots , Normality plots with tests
Tests of Normality
.135 20 .200* .918 20 .092strengthStatistic df Sig. Statistic df Sig.
Kolmogorov-Smirnova
Shapiro-Wilk
This is a lower bound of the true significance.*.
Lilliefors Significance Correctiona.
26
SPSS: equal-variance tests: Homework for ST3900 studentsSPSS: 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 (1st 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 differencesProceed as in one sample case
Notes: SAS: all variables must be included in data SPSS: create/calculate all variables we need