Download presentation
Presentation is loading. Please wait.
Published byYuliana Cahyadi Modified over 6 years ago
1
Happiness comes not from material wealth but less desire.
2
Statistical Package Usage
Topic: Tests for two samples By Prof Kelly Fan, Cal State Univ, East Bay
3
Example: Mortar Strength
Unmodified modified
4
SAS Output Ho: The mean strength of the two formulations are the same
The TTEST Procedure Statistics Lower CL Upper CL Lower CL Upper CL Variable FORMULATION N Mean Mean Mean Std Dev Std Dev Std Dev Std Err STRENGTH M STRENGTH U STRENGTH Diff (1-2) Ho: The mean strength of the two formulations are the same H1: They are different
5
Type II Error, or “ Error” Type I Error, or “ Error”
Types of Errors H0 true H0 false Type II Error, or “ Error” Good! (Correct!) we accept H0 Type I Error, or “ Error” Good! (Correct) we reject H0
6
= Probability of Type I error = P(rej. H0|H0 true)
= Probability of Type II error = P(acc. H0|H0 false) We often preset . The value of depends on the specifics of the H1 (and most often in the real world, we don’t know these specifics).
7
Suppose the Critical Value = 141:
EXAMPLE: H0 : < 100 H1 : >100 Suppose the Critical Value = 141: X =100 C=141
8
These are values corresp.to a value of 25 for the Std. Dev. of X
= P (X < 141/= 150) = .3594 = 150 What is ? 141 = 150 These are values corresp.to a value of 25 for the Std. Dev. of X = P (X < 141/= 160) = .2236 = 160 141 = 160 = 170 = P (X < 141/= 170) = .1230 = 170 141 = P (X < 141/= 180) = 180 = .0594 = P (X < 141|H0 false) 141 = 180
9
Note:. Had been preset at. 025 (instead of
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”.
10
P Value The probability of seeing as extreme as or more extreme than what we observe, assuming Ho is true. The smaller the p-value is, the stronger the evidence against Ho is.
11
One Population Non-parametric test
12
Two independent samples Non-parametric test
13
Normality Tests SAS: PROC UNIVARIATE DATA=** NORMAL;
Tests for Normality Test Statistic p Value------ Shapiro-Wilk W Pr < W Kolmogorov-Smirnov D Pr > D >0.1500 Cramer-von Mises W-Sq Pr > W-Sq Anderson-Darling A-Sq Pr > A-Sq Note: For demonstration purpose, here is the result for testing normality when treating 2 samples as a whole. But you should do the normality test for both samples separately.
14
Equal-variance Tests SAS: PROC TTEST DATA=** ;
15
Non-parametric Tests One sample: Wilcoxon Signed-Rank Test
(Included in the output of Proc Univariate) Two samples: Wilcoxon Rank Sum Test (See p. 191) Three or more samples: Kruskal-Wallis Test (Later)
16
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”
17
Example: Repeated Measures
Each subject is measured twice: Before treatment (control value) After treatment (treatment value) Subject Control Treatment 1 90 95 2 87 92 3 100 104 4 80 89 5 101 6 105
18
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 SAS and SPSS can also conduct paired t-tests directly
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.