Professional Documents
Culture Documents
Module4_Market_Research_1
Module4_Market_Research_1
Module4_Market_Research_1
Marketing Analytics
Module 4 – Market research: Hypothesis Testing I
Jinhee Huh
Hypothesis Testing 1 – Chi-Square and
Student’s t Testing
Group Comparison Example
Hypothesis testing
Hypothesis Testing Process
• Null Hypothesis (H )0
• t-test
• One sample t-test (one variable)
• Testing if a variable’s mean is significantly different from a specific value
• Chi-square test
• One sample chi-square test
• Testing if the observed proportions are equal to a set of known proportions
Source: https://www.globalspec.com/reference/69593/203279/10-7-the-student-s-t-distribution
Step 3: Develop a Decision Rule
• P-value: 0.03
• For 0.05 significance level, we reject the null hypothesis
• For 0.01 significance level, we cannot reject the null hypothesis
Step 3: Develop a Decision Rule
• Calculate the Expected Value for each cell in the cross-tab table, assuming H0 is true
• Example
• H0 : Gender and phone use are NOT related
iPhone ? ? 200
• Calculate the Expected Value for each cell in the cross-tab table, assuming H0 is true
• Example
• H0 : Gender and phone use are NOT related
(Oij Eij ) 2
• For each cell, compute
Eij
i 1 j 1 Eij
• : number of categories of variable 1
• : number of categories of variable 2
• The number of values in the final calculation of a statistic that are free to vary
• Decision Rule
• Reject the null hypothesis if the test statistic is larger than the critical value
Area in Upper Tail
Degree of freedom .10 .05 .01
1 2.70 3.84 6.63
2 4.61 5.99 9.21
3 6.25 7.81 11.34
4 7.78 9.48 13.28
• More intuitively, we find that there is a significant relationship between gender and
iPhone purchase
Step 5: State the Conclusion
22
Student’s t Test
• Hypothesis
• H0: The average sales of stores in city A is the same as that of stores in city B
• H1: The average sales of stores in city A is not same as that of stores in city B
• Data
City Store sales
A 1000 2825 5639 5792 7238 5224 6277
B 3100 2393 4012 1928 8321 7082
Student’s t Test – Unpaired
• Test statistic
• Equal variance:
• Unequal variance:
• ;
Area in Upper Tail
Degree of freedom .10 .05 .025
• 0.29
9 1.383 1.833 2.262
• (for equal variance) 10 1.372 1.812 2.228
11 1.363 2.201 2.201
12 1.356 2.179 2.179
In-Class Practice
25
R program Practice
Chi-square Test
• Chi-square test function
• chisq.test(frequency table)
• chisq.test can be operated on a frequency table
• Example
• tmp.tab <- table(rep(c(1:4), times=c(25,25,25,20)))
• tmp.tab
• chisq.test(tmp.tab)
• t.test(x, mu=m0)
• One sample t-test
• H0: mu = m0 (m0 is a specific numeric value. If not specified, m0 = 0)
• t.test(x1, x2)
• x1 and x2 are numeric variables
• Comparing average values
• t.test(x1~x2)
• x1 is numeric and x2 is binary factor variable
• Comparing the average value of group 1 in x2 and that of group 2 in x2
Student’s t Test
• Two sample t-test
• Is the home owner’s mean age different from the non-home owner’s average
age?
• Is the average income different between male “Urban hip” (segment: “Urban
hip”) consumers and female “Urban hip” consumers?