Title: URBP 204A QUANTITATIVE METHODS I Statistical Analysis Lecture IV
1URBP 204A QUANTITATIVE METHODS IStatistical
Analysis Lecture IV
- Gregory Newmark
- San Jose State University
- (This lecture is based on Chapters 5,12,13, 15
of Neil Salkinds - Statistics for People who (Think They) Hate
Statistics, 2nd Edition - which is also the source of many of the offered
examples. All cartoons are from CAUSEweb.org by
J.B. Landers.)
2More Statistical Tests
- Factorial Analysis of Variance (ANOVA)
- Tests between means of more than two groups for
two or more factors (independent variables) - Correlation Coefficient
- Tests the association between two variables
- One Sample Chi-Square (?2)
- Tests if an observed distribution of frequencies
for one factor is what one would expect by chance - Two Factor Chi-Square (?2)
- Tests if an observed distribution of frequencies
for two factors is what one would expect by chance
3Factorial ANOVA
- Compares observations of a single variable among
two or more groups which incorporate two or more
factors. - Examples
- Reading Skills
- School (Elementary, Middle, High)
- Academic Philosophy (Montessori, Waldorf)
- Environmental Knowledge
- Commute Mode (Car, Bus, Walking)
- Age (Under 40, 40)
- Wealth
- Favorite Team (As, Giants, Dodger, Angels)
- Home Location (Oakland, SF, LA)
- Weight Loss
- Gender (Male, Female)
- Exercise (Biking, Running)
4Factorial ANOVA
- Two Types of Effects
- Main Effects differences within one factor
- Interaction Effects differences across factors
- Example
- Weight Loss
- Gender (Male, Female)
- Exercise (Biking, Running)
- Main Effects
- Does weight loss vary by exercise?
- Does weight loss vary by gender?
- Interaction Effects
- Does weight loss due to exercise vary by gender?
5Factorial ANOVA
- Example
- How is weight loss affected by exercise program
and gender? - Steps
- State hypotheses
- Null
- H0 µMale µFemale
- H0 µBiking µRunning
- H0 µMale-Biking µFemale-Biking
µMale-Running µFemale-Running - Research
- What would these three be?
6Factorial ANOVA
- Steps (Continued)
- Set significance level
- Level of risk of Type I Error 5
- Level of Significance (p) 0.05
- Select statistical test
- Factorial ANOVA
- Computation of obtained test statistic value
- Insert obtained data into appropriate formula
- (SPSS can expedite this step for us)
7Factorial ANOVA
Male-Biking Male-Running Female-Biking Female-Running
76 88 65 65
78 76 90 67
76 76 65 67
76 76 90 87
76 56 65 78
74 76 90 56
74 76 90 54
76 98 79 56
76 88 70 54
55 78 90 56
8Factorial ANOVA
p
9Factorial ANOVA
10Factorial ANOVA
11Factorial ANOVA
- Steps (Continued)
- Computation of obtained test statistic value
- Exercise F 2.444, p 0.127
- Gender F 1.908, p 0.176
- Interaction F 9.683, p 0.004
- Look up the critical F score
- dfnumerator of Factors 1
- dfdenominator of Observations of Groups
- What is the critical F score?
- Comparison of obtained and critical values
- If obtained gt critical reject the null hypothesis
- If obtained lt critical stick with the null
hypothesis
12Factorial ANOVA
- Steps (Continued)
- Therefore we reject the null hypothesis for the
interaction effects. This means that while
choice of exercise alone and gender alone make no
difference to weight loss, in combination they do
differentially affect weight loss. Men should
run and women should bike, according to these
data.
13Correlation Coefficient
- Tests whether changes in two variables are
related - Examples
- Are property values positively related to
distance from waste dumps? - Is age correlated with height for minors?
- Are apartment rents negatively related to
commute time? - Does someones height relate to income?
- How related are hand size and height?
14Correlation Coefficient
- Are Tastiness and Ease correlated for fruit?
- Is there directionality?
15Correlation Coefficient
- Numeric index that reflects the linear
relationship between two variables (bivariate
correlation) - How does the value of one variable change when
another variable changes? - Each case has two data points
- E.g. This study records each persons height and
weight to see if they are correlated. - Ranges from -1.0 to 1.0
- Two types of possible correlations
- Change in the same direction positive or direct
correlation - Change in opposite directions negative or
indirect correlation - Absolute value reflects strength of correlation
- Pearson Product-Moment Correlation
- Both variables need to be ratio or interval
16Correlation Coefficient
17Correlation Coefficient
- Coefficient of Determination
- Squaring the correlation coefficient (r2)
- The percentage of variance in one variable that
is accounted for by the variance in another
variable - Example GPA and Time Spent Studying
- rGPA and Study Time 0.70 r2GPA and Study
Time 0.49 - 49 of the variance in GPA can be explained by
the variance in studying time - GPA and studying time share 49 of the variance
between themselves
18Correlation Coefficient
- Example
- How related are hand size and height?
- Steps
- State hypotheses
- Null H0 ?Hand Size and Height 0
- Research H1 rHand Size and Height ? 0
- Non-directional
- Set significance level
- Level of risk of Type I Error 5
- Level of Significance (p) 0.05
19Correlation Coefficient
- Steps (Continued)
- Select statistical test
- Correlation Coefficient (it is the test
statistic!) - Computation of obtained test statistic value
- Insert obtained data into appropriate formula
20Correlation Coefficient
21Correlation Coefficient
- Steps (Continued)
- Computation of obtained test statistic value
- rHand Size and Height 0.736
Correlations Correlations Correlations Correlations
Height Hand
Height Pearson Correlation 1 .736
Height Sig. (2-tailed) .000
Height N 30 30
Hand Pearson Correlation .736 1
Hand Sig. (2-tailed) .000
Hand N 30 30
. Correlation is significant at the 0.01 level (2-tailed). . Correlation is significant at the 0.01 level (2-tailed). . Correlation is significant at the 0.01 level (2-tailed). . Correlation is significant at the 0.01 level (2-tailed).
22Correlation Coefficient
- Steps (Continued)
- Computation of critical test statistic value
- Value needed to reject null hypothesis
- Look up p 0.05 in critical value table
- Consider degrees of freedom df n 2
- Consider number of tails (is there
directionality?) - rcritical ?
23Correlation Coefficient
- What happens to the critical score when the
number of cases (n) decreases? Why?
24Correlation Coefficient
- Steps (Continued)
- Comparison of obtained and critical values
- If obtained gt critical reject the null hypothesis
- If obtained lt critical stick with the null
hypothesis - robtained 0.736 gt rcritical 0.349
- Therefore, we reject the null hypothesis and
accept the research hypothesis that height and
handbreadth are correlated. - Is there a directionality to that correlation?
25Correlation Coefficient
- Significance vs. Meaning
- Rules of Thumb
- r 0.8 to 1.0 Very strong relationship
- r 0.6 to 0.8 Strong relationship
- r 0.4 to 0.6 Moderate relationship
- r 0.2 to 0.4 Weak relationship
- r 0.0 to 0.2 Weak or no relationship
26Correlation Coefficient
- Does correlation express causation?
- Classic Example
- Ice Cream Eaten
- Crimes Committed
27Correlation Coefficient
- Correlation expresses association only
28Chi-Square (?2)
- Non-Parametric Test
- Does not rely on a given distribution
- Useful for small sample sizes
- Enables consideration of data that comes as
ordinal or nominal frequencies - Number of children in different grades
- Percentage of people by state receiving social
security
29One Sample Chi-Square (?2)
- Tests whether an observed distribution of
frequencies for one factor is likely to have
occurred by chance - Examples
- Is this community evenly distributed among
ethnic groups? - Are the 31 ice cream flavors at Baskin Robbins
equally purchased? - Are commuting mode shares evenly spread out?
- Did people report equal preferences for a school
voucher policy?
30One Sample Chi-Square (?2)
- Examples
- Did people report equal preferences for a school
voucher policy? - Data (90 People split into 3 Categories)
- For 23
- Maybe 17
- Against 50
- Always try to have at least 5 responses per
category
31One Sample Chi-Square (?2)
- Steps
- State hypotheses
- Null
- H0 ProportionFor ProportionMaybe
ProportionAgainst - Research
- H1 ProportionFor ? ProportionMaybe ?
ProportionAgainst - Set significance level
- Level of risk of Type I Error 5
- Level of Significance (p) 0.05
- Select statistical test
- Chi-Square (?2)
32One Sample Chi-Square (?2)
- Steps (Continued)
- Computation of obtained test statistic value
- Insert obtained data into appropriate formula
- (SPSS can expedite this step for us)
33One Sample Chi-Square (?2)
- Steps (Continued)
- Computation of obtained test statistic value
Category O E (O-E) (O-E)2 (O-E)2/E
For 23 30 -7 49 1.63
Against 17 30 -13 169 5.63
Maybe 50 30 20 400 13.33
Total 90 90 -- -- 20.59
34One Sample Chi-Square (?2)
- Steps (Continued)
- Computation of obtained test statistic value
- ?2 obtained 20.59
- Computation of critical test statistic value
- Value needed to reject null hypothesis
- Look up p 0.05 in ?2 table
- Consider degrees of freedom df of categories
- 1 - ?2 critical 5.99
35One Sample Chi-Square (?2)
- Steps (Continued)
- Computation of obtained test statistic value
36One Sample Chi-Square (?2)
- Steps (Continued)
- Comparison of obtained and critical values
- If obtained gt critical reject the null hypothesis
- If obtained lt critical stick with the null
hypothesis - ?2 obtained 20.59 gt ?2 critical 5.99
- Therefore, we can reject the null hypothesis and
we thus conclude that distribution of preferences
regarding the school voucher is not even.
37Two Factor Chi-Square (?2)
- What if we want to see if gender effects the
distribution of votes? - How is this different from Factorial ANOVA?
38Two Factor Chi-Square (?2)
- Steps
- State hypotheses
- Null
- H0 PForMale PMaybeMale PAgainst Male
PForFemale PMaybeFemale PAgainst Female - Research
- H1 PForMale ? PMaybeMale ? PAgainst Male ?
PForFemale ? PMaybeFemale ? PAgainst Female - Set significance level
- Level of risk of Type I Error 5
- Level of Significance (p) 0.05
- Select statistical test
- Chi-Square (?2)
39Two Factor Chi-Square (?2)
- Steps (Continued)
- Computation of obtained test statistic value
- Insert obtained data into appropriate formula
- Same as for One Factor Chi-Square
40Two Factor Chi-Square (?2)
- How do we find the expected frequencies?
- (Row Total Column Total)/ Total Total
- Expected Value ForMale (2344)/90 11.2
41Two Factor Chi-Square (?2)
- Steps (Continued)
- Computation of obtained test statistic value
- ?2 obtained 7.750
42Two Factor Chi-Square (?2)
- Steps (Continued)
- Computation of critical test statistic value
- Value needed to reject null hypothesis
- Look up p 0.05 in ?2 table
- Consider degrees of freedom
- df ( of rows 1) ( of columns 1)
- ?2 critical ?
43Two Factor Chi-Square (?2)
- Steps (Continued)
- Comparison of obtained and critical values
- If obtained gt critical reject the null hypothesis
- If obtained lt critical stick with the null
hypothesis - ?2 obtained 7.750 gt ?2 critical 5.99
- Therefore, we can reject the null hypothesis and
we thus conclude that gender affects the
distribution of preferences regarding the school
vouchers.
44Tutorial Time