π Lecture 30 β Chi-Square Test
π Overview: This lecture introduces the Chi-Square test, a statistical method used to determine whether there is a systematic association between two variables under investigation. It explains how cross-tabulation works and demonstrates the application of Chi-Square statistics through both univariate and bivariate data examples.
ποΈ Topics Covered
The lecture covers the Chi-Square test as a test of association, explaining null and alternative hypotheses, observed and expected frequencies, and cross tabulation. It then examines univariate data with two detailed examples β one analyzing color preferences for plastic products and another evaluating TV picture quality among different brands β showing step-by-step calculations and hypothesis testing procedures.
π Lecture Summary
Chi βSquare Test
It is a test of association. It determines whether there is a systematic association in two variables under investigation. The null hypothesis would be that there is no association (or dependence) between the variables and accordingly an alternative hypothesis will be framed. In this test, observed and expected frequencies are computed and cross tabulation is done.
Cross Tabulation
Cross tabulation shows two or more variables at a time. It merges responses with regard to two or more variables in the same table. Frequencies of one variable are cross tabulated and distributed according to other categories.
π Example: Gender of students who visited Lahore zoo:
| Boys | Girls | Total | |
|---|---|---|---|
| Frequent visitors | 45 | 20 | 65 |
| Less frequent visitors | 23 | 47 | 70 |
| Total | 68 | 67 | 135 |
How Many Variables?
We may have one or two variables to test through Chi-Square. Thus the data are called univariate and bivariate respectively. Cross tabulation is done accordingly.
Univariate Data β (Example # 01)
A plastic company sells its products in three primary colors: yellow, blue & red. The marketing manager thinks that customers do not have any color preference. Manager set up a test where 240 purchasers were provided equal opportunity to buy any of the color. Results: 40 bought blue, 120 bought red and 80 yellow.
π Hypothesis:
- Hβ: There is no color preference of purchaser of plastic among three colors
- Hβ: There is a color preference
π Formula: ΟΒ² = Ξ£ [(fo - fe)Β² / fe] β Sum of (observed frequency minus expected frequency squared divided by expected frequency)
π Example Calculation:
- Yellow: fo=80, fe=80, (fo-fe)=0, (fo-fe)Β²=0, value=0
- Blue: fo=40, fe=80, (fo-fe)=-40, (fo-fe)Β²=1600, value=20
- Red: fo=120, fe=80, (fo-fe)=40, (fo-fe)Β²=1600, value=20
- Total ΟΒ² = 40
Degrees of freedom: V = k-1 = 3-1 = 2 Critical value at 0.05 level: 5.99
Since 40 > 5.99, Hβ is rejected and Hβ accepted. Red is most popular color, Blue is least.
Univariate Data (Example # 02)
A research company wanted to find out the best quality of picture in various brands of TV. 6 color TV sets were placed with brand names covered. 1302 people gave their opinion.
| TV brand | Number labeling as best picture |
|---|---|
| M | 675 |
| N | 280 |
| O | 81 |
| P | 119 |
| Q | 123 |
| R | 22 |
Test: Null hypothesis at Ξ± = 0.05 that all brands have same picture quality.
π Analysis: A contingency table is prepared showing expected values. Each expected value = 1302/6 = 217
π Critical value: With v = k-1 = 6-1 = 5 degrees of freedom at Ξ± = 0.05, the critical ΟΒ² value = 11.07
π Result: Calculated ΟΒ² = 1331.39, which is greater than critical value 11.07. Hence null hypothesis is rejected.
π‘ Why this matters: When the calculated Chi-Square value far exceeds the critical value, it strongly indicates that the observed differences are statistically significant and not due to random chance.
β Key Takeaways
The Chi-Square test determines whether there is a systematic association between variables by comparing observed frequencies with expected frequencies under the null hypothesis of no association. Cross tabulation organizes data by merging responses across two or more variables simultaneously. For univariate data, degrees of freedom are calculated as k-1 where k is the number of categories. A calculated Chi-Square value exceeding the critical value leads to rejection of the null hypothesis, indicating significant differences exist among categories. Expected frequencies are computed by dividing the total number of observations by the number of categories when testing for equal distribution.
π§ Quick Revision Questions
- What is the null hypothesis in a Chi-Square test of association?
- How is cross tabulation defined and what purpose does it serve?
- In Example #01 (color preference), why was the expected frequency 80 for all three colors?
- What is the formula for degrees of freedom in univariate Chi-Square analysis?
- Why was the null hypothesis rejected in Example #02 (TV picture quality) when the calculated value was 1331.39 and the critical value was 11.07?
π Lecture 31 β Bivariate Chi-Square
π Overview: This lecture introduces the Chi-Square test of independence for analyzing relationships between two categorical variables. Using real hotel guest satisfaction data and education-confidence examples, it demonstrates how to compute expected frequencies, test statistics, and interpret results to determine whether variables are related or independent.
ποΈ Topics Covered
The lecture covers the Bivariate Chi-Square test for contingency tables, including formulation of null and alternative hypotheses, computation of observed and expected frequencies, degrees of freedom determination, calculation of the chi-square test statistic, comparison with critical values, and interpretation of results through two worked examples involving hotel guest reasons for not returning and education-confidence relationships.
π Lecture Summary
Data analysis
The lecture presents a survey on hotel guest satisfaction where respondents from three hotels (A, B, and C) indicated they were not likely to return and provided their primary reason. The reasons included room rent (78 guests), location (70 guests), room space (42 guests), and other reasons (39 guests). Across hotels, 109 guests were from Hotel A, 42 from Hotel B, and 78 from Hotel C who were not planning to return.
The null hypothesis (Hβ) states there is no relationship between the primary reason for not returning and the hotels. The alternative hypothesis (Hβ) states there is a relationship between these two variables.
Observed Frequencies
The contingency table presents the joint tallies of sampled guests with respect to primary reason for not returning and hotel property:
| Reason for not Returning | Hotel A | Hotel B | Hotel C | Total |
|---|---|---|---|---|
| Room rent | 40 | 14 | 24 | 78 |
| Location | 32 | 12 | 26 | 70 |
| Room space | 19 | 8 | 15 | 42 |
| Other | 18 | 8 | 13 | 39 |
| Total | 109 | 42 | 78 | 229 |
To test the null hypothesis of independence, the chi-square test statistic is computed using the formula:
π Formula: ΟΒ² = Ξ£ (fβ - fβ)Β² / fβ β Where fβ = observed frequency in each cell, fβ = expected frequency in each cell, and the sum is taken over all cells
Computed the Expected Frequencies
The expected frequency in a cell is the product of its row total and column total divided by the overall sample size:
π Definition β Expected frequency (fβ): fβ = (row total Γ column total) / n where row total = sum of all frequencies in a row, column total = sum of all frequencies in a column, n = overall sample size
| Reason for not Returning | Hotel A | Hotel B | Hotel C | Total |
|---|---|---|---|---|
| Room rent | 37.12 | 14.30 | 26.56 | 78 |
| Location | 33.31 | 12.83 | 23.84 | 70 |
| Room space | 19.99 | 7.7 | 14.30 | 42 |
| Other | 18.56 | 7.15 | 13.28 | 39 |
| Total | 109 | 42 | 78 | 229 |
π Formula: Degrees of freedom = (r - 1)(c - 1) β For an rΓc contingency table, where r = number of rows and c = number of columns
The chi-square test statistic is computed as shown:
| CELL | fβ | fβ | (fβ-fβ) | (fβ-fβ)Β² | (fβ-fβ)Β²/fβ |
|---|---|---|---|---|---|
| Room rent/Hotel A | 40 | 37.12 | 2.88 | 8.29 | 0.22 |
| Room rent/Hotel B | 14 | 14.30 | -0.3 | 0.09 | 0.006 |
| Room rent/Hotel C | 24 | 26.56 | -2.56 | 6.55 | 0.25 |
| Location/Hotel A | 32 | 33.31 | -1.31 | 1.71 | 0.05 |
| Location/Hotel B | 12 | 12.83 | -0.83 | 0.688 | 0.05 |
| Location/Hotel C | 26 | 23.84 | 2.16 | 4.66 | 0.19 |
| Room space/Hotel A | 19 | 19.99 | -0.99 | 0.98 | 0.04 |
| Room space/Hotel B | 8 | 7.7 | 0.3 | 0.09 | 0.01 |
| Room space/Hotel C | 15 | 14.30 | 0.7 | 0.49 | 0.03 |
| Other/Hotel A | 18 | 18.56 | -0.56 | 0.31 | 0.01 |
| Other/Hotel B | 8 | 7.15 | 0.85 | 0.72 | 0.100 |
| Other/Hotel C | 13 | 13.28 | -0.28 | 0.07 | 0.005 |
| Total | 0.98 |
Using a level of significance of Ξ± = 0.05, the computed test statistic ΟΒ² = 0.98 is less than 12.59, the upper-tail critical value from the chi-square distribution with (4-1)(3-1) = 6 degrees of freedom. Therefore, the null hypothesis of independence is accepted.
π‘ Why this matters: When ΟΒ² is less than the critical value, we conclude there is no significant relationship between the variables β in this case, the primary reason for not returning does not differ significantly across hotels.
Another Example of Chi-Square
The second example examines the relationship between education level and confidence in television programs:
| Education | Under Metric | Upto B.A. | M.A. & Above | Total |
|---|---|---|---|---|
| A great extent | 95 | 57 | 39 | 191 |
| Some extent | 272 | 274 | 214 | 760 |
| Very little | 140 | 163 | 148 | 451 |
| Total | 507 | 494 | 401 | 1402 |
The chi-square test statistic computation:
| Cell | fβ | fβ | Contribution (fβ-fβ)Β²/fβ |
|---|---|---|---|
| Cellβ,β | 95 | 69.1 | 9.71 |
| Cellβ,β | 57 | 67.3 | 1.58 |
| Cellβ,β | 39 | 54.6 | 4.46 |
| Cellβ,β | 272 | 274.8 | 0.03 |
| Cellβ,β | 274 | 267.8 | 0.14 |
| Cellβ,β | 214 | 217.4 | 0.05 |
| Cellβ,β | 140 | 163.1 | 3.27 |
| Cellβ,β | 163 | 158.9 | 0.11 |
| Cellβ,β | 148 | 129.0 | 2.80 |
| ΟΒ² | 22.15 |
Reject or Accept Null Hypothesis
Given a significance level of 0.01 and 4 degrees of freedom [df = (3-1)(3-1) = 4], the critical value of ΟΒ² from the chi-square distribution table is 15.09.
The hypotheses are:
- Hβ: The variables are independent (education and confidence have no relationship)
- Hβ: The variables are not independent (there is a relationship)
The decision rule is:
- If ΟΒ² β€ 15.09, accept Hβ
- If ΟΒ² β₯ 15.09, reject Hβ
Since the computed test statistic ΟΒ² = 22.15 is greater than the critical value 15.09 (22.15 > 15.09), the null hypothesis is rejected. Therefore, the two variables are not independent β there is a significant relationship between education and confidence in television programs. Insights into the nature of this relationship can be obtained by investigating individual cell contributions to the chi-square statistic.
π‘ Why this matters: Individual cell contributions show which combinations of categories contribute most to the relationship. Here, Cellβ,β (Under Metric with "A great extent") has the highest contribution (9.71), suggesting this group differs most from what would be expected under independence.
β Key Takeaways
The Bivariate Chi-Square test determines whether two categorical variables are independent or related by comparing observed frequencies with expected frequencies under independence. The expected frequency for each cell is calculated as (row total Γ column total) Γ· overall sample size, and degrees of freedom are (r-1)(c-1). The test statistic ΟΒ² = Ξ£(fβ-fβ)Β²/fβ follows a chi-square distribution, and the null hypothesis of independence is rejected when the computed ΟΒ² exceeds the critical value at the chosen significance level. In the hotel example, ΟΒ² = 0.98 was less than the critical value of 12.59, so independence was accepted, while in the education-confidence example, ΟΒ² = 22.15 exceeded 15.09, indicating a significant relationship. Individual cell contributions help identify which specific category combinations drive the relationship.
π§ Quick Revision Questions
- What is the formula for calculating expected frequencies in a chi-square test of independence?
- How many degrees of freedom are there for a 4Γ3 contingency table?
- In the hotel guest satisfaction example, was the null hypothesis accepted or rejected, and why?
- What does it mean when an individual cell's contribution to the chi-square statistic is large?
- For the education-confidence example, what were the null and alternative hypotheses, and what was the conclusion at Ξ± = 0.01?
π Lecture 32 β Correlation and Regression
π Overview: This lecture explores the measurement of relationships between variables in marketing research. It explains how to quantify associations using correlation, differentiating between types like non-monotonic, monotonic, and linear relationships. The primary focus is on the Product Moment (Pearson) correlation coefficient and Spearman's Rank Order correlation, providing formulas, examples, and interpretation guidelines essential for analyzing interval and ordinal data.
ποΈ Topics Covered
This lecture begins by discussing different types of relationships between variables, specifically non-monotonic and monotonic relationships. It then introduces linear correlation and the coefficient of correlation (r) as a measure of association for interval/ratio data, including its strength and direction. The Product Moment (Pearson) Correlation coefficient is defined with its formula and demonstrated through two detailed examples. Finally, the lecture covers Rank Order Correlation, specifically Spearman's rank order correlation, for ordinal data, with examples.
π Lecture Summary
Correlation and Regression
Many marketing research projects study relationships, such as between sales revenue and advertising expenses, market share and number of salespeople, or sales and distance to competing stores. Association between categories from nominal data was discussed with chi-square. Association between two interval-scaled data is measured through correlation. Correlations are various types and used for various purposes such as nonmonotonic, monotonic, linear, curvilinear, rank order, etc.
Non-monotonic Relationship
A non-monotonic relationship is one where the presence or absence of one variable is systematically associated with the presence or absence of another variable, but there is no discernable direction of relationship. However, the relationship exists. For example, in a fast food restaurant, experience tells us that morning customers buy tea but afternoon customers typically purchase soft drink. This relationship is in no way exclusive. There is no guarantee that a morning customer would always order tea and an afternoon customer always order soft drink. However, a relationship does exist.
Monotonic Relationship
A monotonic relationship is one where a researcher can assign only a general direction of association between two variables. A monotonic relationship can be either increasing or decreasing. If one variable increases and the other also increases, it is called a monotonic increasing relationship. On the other hand, a monotonic decreasing relationship would be when one variable increases but the other decreases. Monotonic means that the direction of the relationship is described. However, the exact amount of change in one variable as the other variable changes cannot be indicated.
LINEAR CORRELATION
Correlation or linear correlation is a measure of the nature and degree of association or co-variation between two variables. These variables are measured by interval or ratio scales. Co-variation is defined as the amount of change in one variable systematically associated with a change in another variable. The Coefficient of Correlation (r) is the index number that communicates the strength of association between two variables, say X and Y. Strength is indicated by the absolute size of the correlation.
π Definition β Coefficient of Correlation (r): The index number that communicates the strength and direction of association between two variables.
Here is a rule of thumb about the strength of correlation (after it is proved that correlation is statistically significant):
| Range of Coefficient r | Strength of Association |
|---|---|
| 0.00 to Β±0.20 | None |
| Β±0.21 to Β±0.40 | Very weak |
| Β±0.41 to Β±0.80 | Moderate |
| Β±0.81 to Β±1.00 | Strong |
Correlation coefficients that are closer to zero indicate that there is no systematic association between the two variables, and the ones which are closer to Β±1.0 show that there is some systematic association between two variables. Direction of association is indicated by the sign (+ or -) of the size of the coefficient. If the sign is positive, it means there is a positive direction of the co-variation between the two variables, that is, both variables change in the same direction. In this case if variable X increases, Y would also increase. On the other hand, a negative sign in correlation indicates a negative co-variation, which means if one variable increases the other would decrease and vice versa.
π Example: If we find that number of years of education (variable X) and hours in reading newspaper (variable Y) have a correlation of 0.87, it means they are positively correlated. It will be interpreted like this: people with more education spend more time reading newspapers. But if we find a correlation of -0.81 between smoking cigarettes and education, it means more educated people smoke less.
Product Moment Correlation
Product Moment correlation is the statistic widely used in determining the size or strength of association between two interval or ratio scaled variables. It is also known as the Pearson Correlation Coefficient as it was originally proposed by Karl Pearson. Sometimes it is also called bivariate correlation, simple correlation or correlation coefficient.
π Formula: $$r_{xy} = \frac{\sum{(x - \bar{x})(y - \bar{y})}}{\sqrt{\sum{(x - \bar{x})^2} \cdot \sum{(y - \bar{y})^2}}}$$
Where X and Y are the two variables, $\bar{x}$ and $\bar{y}$ are their respective means and $r_{xy}$ is the correlation between X and Y.
Example 1: A company wants to find out if the number of salespersons in a sales territory has some relationship with the sales revenue. From a random sample of 10 territories, the following data were obtained:
| Territory # | # of Sales Persons (X) | Sales in 000 Rupees (Y) |
|---|---|---|
| 1 | 5 | 261 |
| 2 | 7 | 288 |
| 3 | 6 | 381 |
| 4 | 9 | 412 |
| 5 | 12 | 440 |
| 6 | 8 | 317 |
| 7 | 11 | 567 |
| 8 | 16 | 572 |
| 9 | 13 | 428 |
| 10 | 7 | 317 |
Solution: First, calculate the means: $\bar{x} = 9.4$, $\bar{y} = 398$.
| x | y | $(x - \bar{x})$ | $(x - \bar{x})^2$ | $(y - \bar{y})$ | $(y - \bar{y})^2$ | $(x - \bar{x})(y - \bar{y})$ |
|---|---|---|---|---|---|---|
| 5 | 261 | -4.4 | 19.36 | -127 | 16129 | 558.8 |
| 7 | 288 | -2.4 | 5.76 | -100 | 10000 | 240 |
| 6 | 381 | -3.4 | 11.56 | -7 | 49 | 23.8 |
| 9 | 412 | -.4 | .16 | 16 | 576 | -9.6 |
| 12 | 440 | 2.6 | 6.76 | 52 | 2704 | 135.2 |
| 8 | 317 | -1.4 | 1.96 | -71 | 5041 | 99.4 |
| 11 | 567 | 1.6 | 2.56 | 179 | 32041 | 286.4 |
| 16 | 569 | 6.6 | 43.56 | 181 | 32761 | 1194.6 |
| 13 | 428 | 3.6 | 12.96 | 40 | 1600 | 144 |
| 7 | 317 | -2.4 | 5.76 | -71 | 5041 | 170.4 |
| Sum | 110.4 | 104942 | 2843 |
$$r_{xy} = \frac{2843}{\sqrt{110.4 \times 104942}} = \frac{2843}{\sqrt{11585670.4}} = \frac{2843}{3403.76} = .84$$
There is a moderate positive correlation between the two variables.
Example II: A researcher is interested to find out whether the high price of large refrigerators compensates in terms of saving energy. He collected data on price and annual cost of consumption of electricity in terms of rupees from a random sample of 8 brands of refrigerators. The data are presented below.
| Refrigerator Brand | Price Rs. 000 (X) | Annual cost of Consumption on electricity Rs. 000 (Y) |
|---|---|---|
| A | 85 | 4.8 |
| B | 76 | 5.4 |
| C | 90 | 5.8 |
| D | 87 | 6.6 |
| E | 110 | 7.7 |
| F | 80 | 6.6 |
| G | 65 | 7.0 |
| H | 75 | 8.1 |
Find the coefficient of correlation r. What do you say about it?
$$r_{xy} = \frac{10.01}{10.49} = .96$$
There is a strong positive correlation between the two variables.
Rank Order Correlation
We use Rank Order Correlation coefficient in data analysis to measure the monotonic relationship between two variables measured on an ordinal scale. That is when the data are ordered into ranks.
π Definition β Spearman's Rank Order Correlation (rs): A measure that indicates the direction and degree of association between two sets of rankings.
π Formula: $$r_s = 1 - \frac{6(\sum d^2)}{n(n^2 - 1)}$$
Where:
- $r_s$ = Spearmanβs rank order correlation
- d = difference of ranks in the paired ranking
- n = number of items ranked
Example: Ranking of various toothpaste brands according to consumer perception on their decay prevention and whitening ability.
| Toothpaste Brand | Decay Prevention Rating | Whitening Rating |
|---|---|---|
| ... | ... | ... |
The computation of Spearman rank order correlation in this example is as follows: $$r_s = 1 - \frac{6(\sum d^2)}{n(n^2 - 1)} = 1 - \frac{6 \times 156}{8(8^2 - 1)} = 1 - \frac{936}{8(63)} = 1 - \frac{936}{504} = 1 - 1.86 = -.86$$
A Spearman rank order correlation of -.86 shows a fairly strong relationship between the two rank orders i.e., decay prevention and whitening ability for the toothpaste brands under study. A negative sign indicates that the relationship is negative, which means if the ranks are higher on decay prevention, these are lower on whitening ability. These are the perceived rankings by the respondent.
Example: Spearmanβs Rank Order Correlation: Two judges were asked to rate six brands of tissue papers. Their ratings are given below. Find out the Spearmanβs rank order correlation between the ratings assigned by two judges.
| Tissue Brand | Judge I Rank | Judge II Rank |
|---|---|---|
| G | 2 | 6 |
| H | 3 | 3 |
| I | 6 | 5 |
| J | 1 | 4 |
| K | 5 | 2 |
| L | 4 | 1 |
The Spearman rank correlation coefficient is β.26, which is very weak and it is in the opposite direction.
π‘ Why this matters: Understanding correlation helps marketers quantify the strength and direction of relationships between variables, such as advertising spend and sales. This allows for more informed decision-making and resource allocation. The choice of correlation method depends on the data's scale of measurement (interval vs. ordinal).
β Key Takeaways
The core of this lecture is understanding that correlation measures the strength and direction of a linear relationship between two variables. The Pearson correlation coefficient (r) is for interval/ratio data, ranging from -1 to +1, where its absolute value indicates strength (with Β±0.81 being strong) and its sign indicates direction. Spearman's rank order correlation (rs) is the non-parametric equivalent used for ordinal (ranked) data. It is crucial to remember that correlation does not imply causation; a strong correlation only indicates an association, not that one variable causes the other to change.
π§ Quick Revision Questions
- What is the fundamental difference between a monotonic and a non-monotonic relationship?
- For an interval-scaled variable, which correlation coefficient would you use to measure its linear association with another interval-scaled variable?
- Interpret a Pearson correlation coefficient (r) of -0.85 between advertising spend and customer complaints. What does this tell you about the relationship?
- You have two sets of rankings for five brands. What formula would you use to measure the association between these rankings?
- According to the lecture's rule of thumb, what is the strength of association for a correlation coefficient of +0.35?
π Lecture 33 β Testing the difference between the Means
π Overview: This lecture addresses how marketing researchers test hypotheses about differences between means, such as comparing a sample mean to a population mean or comparing two independent sample means. It explains the appropriate use of the z-test and t-test based on sample size and knowledge of population standard deviation, and provides worked examples to illustrate the procedure.
ποΈ Topics Covered
The lecture begins by establishing the context for testing differences between means, distinguishing when to use chi-square (nominal data), Spearmanβs correlation (ordinal data), and z/t-tests (interval data). It then explains the conditions for choosing between the z-test and t-test based on sample size and population standard deviation. The method for calculating standard error of the mean difference for one mean and two means is presented. Finally, two complete examples are given: a one-sample z-test for a shoe companyβs new design decision, and a two-sample z-test comparing weekly consumption of two cola beverages.
π Lecture Summary
Testing the difference between the Means
Marketing research may face the problem of testing hypotheses relating to the difference between means. Such means may be the sample mean and population mean or two independent means.
Chi-square is one procedure used to test the significance of difference of data derived from nominal data. For ordinal data, we may use Spearmanβs correlation. We use different statistics to test the difference between means based on interval data. These statistical tests are classified by whether one or two samples are involved: one mean from a sample may be compared with a mean hypothesized to exist in the population, or two means generated from independent samples.
The z-test and the t-test are appropriate to test the difference between the means. The choice is made based on the researcherβs knowledge about the standard deviation of the population and the sample size. It is appropriate to use these tests in the following situations:
- If sample size is more than 30 & population standard deviation is unknown, use z-test.
- If sample size is less than 30 and population standard deviation is unknown, use t-test.
How to Calculate Z or T?
In order to calculate z or t statistics, we need to have calculated the population mean and standard deviation of one or more samples being tested. Then we calculate the standard error of the mean difference. In the case of one mean, the standard error of the mean is:
π Definition β Standard Error of the Mean (Sx): The standard deviation of the sampling distribution of the sample mean, measuring how much the sample mean is expected to vary from the population mean. π Formula: Sx = S / βn β (Sample standard deviation divided by the square root of the sample size)
In the case of two means, the standard error will be: π Formula: Sxβ-xβ = β[(SβΒ²/nβ) + (SβΒ²/nβ)] β (Square root of the sum of the variance of sample 1 divided by its size plus the variance of sample 2 divided by its size)
The z or t is calculated by the following formulas.
For One Mean: π Formula: z (or t) = (xΜ - ΞΌ) / Sx Where:
- ΞΌ = population mean (hypothesized)
- xΜ = sample mean
- Sx = standard error of the mean difference
Example I: One-Sample Z-Test
A shoe company is investigating the desirability of adding a new design of shoes to its shop. The company has decided that it will add this design only if it sells 100 pairs per week in each store. It was put on 40 different shops randomly and data on their sale was calculated. The data revealed an average sale of 106 pairs per week per store. The standard deviation was 13.8. Should the company introduce the new design?
Solution:
- Hypotheses:
- Hβ: ΞΌ β€ 100 (Null hypothesis: mean sales are less than or equal to 100)
- Hβ: ΞΌ > 100 (Alternative hypothesis: mean sales are greater than 100)
- Given:
- Sample mean (xΜ) = 106
- Sample standard deviation (S) = 13.8
- Sample size (n) = 40
- Population mean (ΞΌ) = 100
- Calculate Standard Error:
- Sx = S / βn = 13.8 / β40 = 13.8 / 6.32 = 2.18
- Choose test: Since sample size > 30 and population standard deviation is unknown, use z-test.
- Calculate z-statistic:
- z = (xΜ - ΞΌ) / Sx = (106 - 100) / 2.18 = 6 / 2.18 = 2.75
- Decision: The critical value of z at the 0.05 confidence level for a one-tailed test is 1.645 (the lecture text says 1.96, which is for a two-tailed test; 1.645 is the standard for a one-tailed test at 0.05). Since the calculated z (2.75) exceeds the critical value (1.645), the null hypothesis is rejected.
- Conclusion: The company should go ahead and introduce the new shoes.
π Example: The shoe company found a sample mean of 106 pairs, which was 2.75 standard errors above the hypothesized mean of 100. This is a statistically significant difference, justifying the decision to add the new design.
Example of Z-Test for Two Independent Means
Let us take the example of a z-test for two means. Suppose two independent samples of 50 each of the two cola beverages A and B yield the following data on average weekly per household consumption in Gulberg area of Lahore.
- Cola beverage A: mean consumption = 6.3 liters, standard deviation = 2.1
- Cola beverage B: mean consumption = 5.7 liters, standard deviation = 1.3
Solution:
- Hypotheses:
- Hβ: ΞΌA = ΞΌB (No significant difference between the means)
- Hβ: ΞΌA β ΞΌB (Significant difference between the means)
- Given:
- xΜA = 6.3, SA = 2.1, nA = 50
- xΜB = 5.7, SB = 1.3, nB = 50
- Calculate Standard Error of the Difference between Two Means:
- Sxβ-xβ = β[(SβΒ²/nβ) + (SβΒ²/nβ)] = β[(2.1Β² / 50) + (1.3Β² / 50)] = β[(4.41 / 50) + (1.69 / 50)]
- Sxβ-xβ = β[0.0882 + 0.0338] = β0.122 = 0.349
- Choose test: Since both samples are more than 30, we select z-test.
- Calculate z-statistic:
- z = (xΜA - xΜB) / Sxβ-xβ = (6.3 - 5.7) / 0.349 = 0.6 / 0.349 = 1.72
- Decision: This is a two-tailed test. The critical value of z at the 0.05 significance level is 1.96. Since the calculated value of z (1.72) is less than the critical value (1.96), we fail to reject the null hypothesis.
- Conclusion: There is no significant difference between the average weekly consumption per household of the two brands.
π Example: The difference in average consumption between Cola A (6.3 liters) and Cola B (5.7 liters) was 0.6 liters. The calculated z-statistic of 1.72 was less than the critical value of 1.96, so this observed difference is not statistically significant at the 0.05 level.
π‘ Why this matters: These tests are fundamental for making data-driven marketing decisions. The shoe company example shows how to use a one-sample test to decide on product launches, while the cola example shows how to use a two-sample test to compare brand performance, without relying on assumptions.
β Key Takeaways
The choice between a z-test and t-test depends on sample size and knowledge of population standard deviation; use z-test for samples over 30 when the population standard deviation is unknown, and t-test for samples under 30 in the same situation. The standard error of the mean is calculated as S/βn for one sample and β[(SβΒ²/nβ)+(SβΒ²/nβ)] for two independent samples. In the one-sample shoe example, a calculated z of 2.75 exceeded the critical value, leading to the rejection of the null hypothesis and a recommendation to launch the new design. In the two-sample cola example, a calculated z of 1.72 was less than the critical value of 1.96, leading to the conclusion that there is no significant difference in weekly consumption between the two brands. The z-statistic is the difference between sample and hypothesized means (or difference between two sample means) divided by the standard error of that difference.
π§ Quick Revision Questions
- What are the conditions for choosing a z-test over a t-test when testing the difference between means?
- How do you calculate the standard error of the mean for a single sample and for the difference between two independent samples?
- In the shoe company example, what was the null hypothesis, and why was the calculated z-statistic (2.75) sufficient to reject it?
- In the two-sample cola example, why was a two-tailed test used, and what does a calculated z of 1.72 compared to a critical value of 1.96 lead you to conclude?
- Explain why the standard error is a crucial component in calculating both the z-statistic and the t-statistic.
π Lecture 34 β Testing the Difference between Means
π Overview: This lecture introduces the t-test for hypothesis testing when sample sizes are small (less than 30) and population variance is unknown. It covers both the t-test for one mean and for two independent means, demonstrating how to calculate test statistics, determine degrees of freedom, and interpret results using real business examples.
ποΈ Topics Covered
The lecture begins by reviewing when to use the t-test versus the z-test and explains how to calculate degrees of freedom. It then walks through a complete example of the t-test for one mean involving customer exchanges at a departmental store. Finally, it presents a detailed example of the t-test for two independent means comparing sales of car polish in plastic versus metal containers across 10 stores each.
π Lecture Summary
t-Test
You may recall that we use t-test if the sample is less than 30 and population variance is not known. z and t are calculated in the same manner with the same formula but in reading the critical value of t from the table of t distribution, we need degree of freedom which is calculated as:
π Definition β Degree of freedom (df): A statistical parameter that determines the specific t-distribution to use when finding critical values.
π Formula: df = (nβ + nβ - 2) β The total sample size minus 2, used when comparing two independent samples.
t-Test for One Mean
Suppose a departmental store manager believes that an average number of customers who exchange merchandise each day is not more than 20. The store records the number of exchanges each day for 26 days it was open for a given month. The researcher calculates a sample mean equal to 22 and standard deviation equal to 5. Do you think managerβs assumption is correct?
Solution
xΜ = 22
n = 26
s = 5
Hypotheses:
Hβ: ΞΌ β€ 20 (Manager's assumption - average exchanges not more than 20)
Hβ: ΞΌ > 20 (Alternate - average exchanges are more than 20)
Standard error of the mean:
Sβ = s/βn = 5/β26 = 5/5.1 = 0.98
Calculated t-value:
t = (xΜ - ΞΌ)/Sβ = (22 - 20)/0.98 = 2.04
Degree of freedom: df = n - 1 = 26 - 1 = 25
Critical value at 0.05 level of significance at 25 df = 1.70 (from t-distribution table for one-tailed test)
As the calculated t (2.04) is greater than 1.70, Hβ is rejected.
Conclusion: Average number of customers who exchange merchandise each day in the store is more than 20. Manager's assumption is incorrect.
t-Test for Two Independent Means
A manufacturer of car polish has recently developed a new polish. The company is considering two different containers for the polish, one metal and one plastic. The company will make final decision after test marketing. The company introduced metal and plastic containers on 10 independent random samples of 10 stores each.
Results:
| Store # | Plastic container | Metal container | Store # | Plastic container | Metal container |
|---|---|---|---|---|---|
| 1 | 416 | 340 | 6 | 358 | 358 |
| 2 | 327 | 385 | 7 | 400 | 352 |
| 3 | 370 | 380 | 8 | 394 | 390 |
| 4 | 380 | 376 | 9 | 390 | 360 |
| 5 | 400 | 382 | 10 | 381 | 385 |
Which container should they introduce?
Solution
Hypotheses:
Hβ: ΞΌβ = ΞΌβ (No difference between sales of plastic and metal containers)
Hβ: ΞΌβ β ΞΌβ (There is a difference in sales)
Descriptive statistics (calculated from data):
Mean of plastic container (xΜβ) = 381.6
Mean of metallic container (xΜβ) = 370.8
Standard deviation of plastic container (sβ) = 25.29
Standard deviation of metallic container (sβ) = 16.97
π‘ Why this matters: In calculating standard deviation for interval data, we derive the sum of squared deviation by (n-1) to get an unbiased estimate of the population variance.
Calculated t-value: The t-statistic for two independent means uses the formula that incorporates the standard deviations and sample sizes of both groups.
Critical value for a two-tailed test at (nβ + nβ - 2) = 10 + 10 - 2 = 18 df at 0.05 level of significance is 2.10.
Since the calculated t-value is less than the critical value of 2.10, the null hypothesis is accepted.
Conclusion: Company can introduce any container. Customers do not have special preference for either container.
β Key Takeaways
The t-test is essential when working with small samples (n < 30) and unknown population variance. For one-mean tests, degrees of freedom equal n-1, while for two independent means, df equals nβ + nβ - 2. The critical value is read from the t-distribution table based on the chosen significance level (typically 0.05) and the direction of the test (one-tailed or two-tailed). A calculated t-value exceeding the critical value leads to rejection of the null hypothesis. In business contexts, t-tests help managers make data-driven decisions about assumptions and product strategies, as demonstrated by the container preference example.
π§ Quick Revision Questions
- What conditions must be met to use a t-test instead of a z-test?
- Calculate the degrees of freedom for a one-mean t-test with a sample of 26 observations.
- In the customer exchange example, why was the null hypothesis rejected when t = 2.04 and the critical value was 1.70?
- For two independent samples of 10 stores each, what is the degrees of freedom for the t-test?
- What was the final business decision in the car polish container example, and why?
π Lecture 35 β Analysis of Variance
π Overview: This lecture introduces Analysis of Variance (ANOVA), a statistical technique used to test differences among more than two means. It explains when to use ANOVA instead of t or z tests, and provides a detailed procedure for conducting one-way ANOVA with a full worked example from marketing research.
ποΈ Topics Covered
The lecture covers the definition and purpose of ANOVA, the distinction between one-way and n-way ANOVA, the key statistical components (SS total, SS between, SS within, mean squares, and F-ratio), and the step-by-step procedure for conducting one-way ANOVA. A complete example involving test marketing of shampoo at three different price levels is worked through to demonstrate the calculations and hypothesis testing process.
π Lecture Summary
Analysis of Variance (ANOVA)
ANOVA is used when a market researcher wants to examine differences among more than two means. While t or z tests handle comparisons between two independent means, ANOVA is the appropriate technique for multiple group comparisons. Although traditionally used for experimental data, ANOVA can also analyze survey or observational data.
In ANOVA, we have one or more independent variables which must be non-metric or categorical, and a dependent variable which is metric (measured through interval or ratio scale). Independent variables that are categorical are also called factors. A particular level of factors or independent variables is called a treatment. If one factor (at different levels) is the treatment, one-way analysis of variance is used. If more than one factor are the treatment, n-way analysis of variance is used. If the set of independent variables contains both categorical and metric variables, analysis of covariance (ANCOVA) is used.
One-way Analysis of Variance
One-way ANOVA is used when the researcher wants to examine differences in the mean values of the dependent variable for several levels of a single independent variable or factor. Examples include:
- Are the attitudes of various channels of distribution (wholesalers, retailers, agents) different towards the company's distribution policies?
- Do different regions differ in sales?
- Are the results of various test markets at different price levels really different?
- Are brands evaluated differently by different groups exposed to ads?
The key statistics related to one-way analysis of variance include:
- Mean Square
- Sum of Squares Between (SS between) β also called variation between groups (VB)
- Sum of Squares Total (SS total) β also called total variation (TV)
- Sum of Squares Within (SS within) β also called variation within groups (VW)
- F ratios
Conducting One-Way ANOVA
The procedure for conducting one-way analysis of variance involves the following steps:
A. Identifying the variables: The researcher first identifies the independent variable with all its levels and the dependent variable. The independent variable is generally denoted by X and the dependent variable by Y. In one-way ANOVA, there is one categorical variable having more than two categories, say the number of categories is c. If each category has n observations, the total sample size will be n Γ c. The researcher then prepares the null and alternate hypotheses.
B. Measure and decompose the variation: Find the total variation in Y and separate it into variation between groups and variation within groups. This is expressed by the equation:
π Definition β SS total = SS between + SS within
SS total is computed by squaring the deviation of each score from the grand mean and summing these squares.
SS within is the variability observed within each group, calculated by squaring the deviation of each score from its group mean and summing these scores. π Formula: SS within = Sum c (x β xΜ_group)Β²
SS between is the variability of the group means about the grand mean, computed by squaring the deviation of each group mean from the grand mean, multiplying by n, and summing them up. π Formula: SS between = Sum [n (xΜ_group β grand mean)Β²]
After calculating SS total, SS between, and SS within, we compute the variance or mean square by dividing the various sum of squares by the appropriate degrees of freedom.
To get Mean Square Between Groups (MS between), SS between is divided by categories minus one (c-1): π Formula: MS between = SS between / (c-1)
To obtain Mean Square Within Groups (MS within), SS within is divided by cn-c degrees of freedom: π Formula: MS within = SS within / (cn - c)
Finally, the F-ratio is found by dividing MS between by MS within: π Formula: F = MS between / MS within
The F-ratio is then checked against the critical value in the relevant F-table for comparison. At the end, the null hypothesis is accepted or rejected, and the conclusion is drawn.
Example
A company wants to launch a new shampoo but is unsure which price will bring more sales. They ran a test in the market before launching the product to decide the final price. The company chose four separate areas, and within each area the product was sold at three different prices in different markets. There were 12 test markets total.
Data from the Test Markets (Unit Sales in 000)
| Market Area | Regular Price (Rs. 325) | Reduced Price (Rs. 315) | Discount (Coupon) |
|---|---|---|---|
| M, N, O | 11 | 12 | 13 |
| P, Q, R | 11 | 14 | 12 |
| S, T, U | 9 | 12 | 9 |
| W, X, Y | 8 | 13 | 10 |
| Mean | 9.75 | 12.75 | 11 |
Grand Mean = 11.17
Solution
Step 1: Calculate SS total SS total = (11-11.17)Β² + (11-11.17)Β² + (9-11.17)Β² + (8-11.17)Β² + (12-11.17)Β² + (14-11.17)Β² + (12-11.17)Β² + (13-11.17)Β² + (13-11.17)Β² + (12-11.17)Β² + (9-11.17)Β² + (10-11.17)Β² = 37.67
Step 2: Calculate SS within SS within = (11-9.75)Β² + (11-9.75)Β² + (9-9.75)Β² + (8-9.75)Β² + (12-12.75)Β² + (14-12.75)Β² + (12-12.75)Β² + (13-12.75)Β² + (13-11)Β² + (12-11)Β² + (9-11)Β² + (10-11)Β² = 19.56
Step 3: Calculate SS between SS between = 4(9.75-11.17)Β² + 4(12.75-11.17)Β² + 4(11-11.17)Β² = 18.17
Step 4: Calculate Mean Squares MS between = 18.17 / (c-1) = 18.17 / 2 = 9.08 MS within = 19.57 / (cn-c) = 19.57 / 9 = 2.17
Step 5: Calculate F-ratio F = 9.08 / 2.17 = 4.178
Step 6: Compare with critical value The F-ratio is 4.178. Comparing with the F-table at (c-1) = 2 degrees of freedom in the numerator and (cn-c) = 9 degrees of freedom in the denominator, the critical value is 4.26. Since 4.178 is less than 4.26, we accept the null hypothesis.
π‘ Why this matters: The calculated F-value being less than the table value means the observed differences in sales across price treatments are not statistically significant.
Conclusion: It appears that there is no real difference in sales produced by different prices. All price treatments produce almost the same sales volume.
β Key Takeaways
ANOVA is the correct statistical technique when comparing means across more than two groups, replacing multiple t-tests. The total variation in the dependent variable (SS total) is decomposed into variation between groups (SS between) and variation within groups (SS within). The F-ratio compares the mean square between groups to the mean square within groups, and this value is compared against a critical value from the F-distribution table using appropriate degrees of freedom. In the shampoo pricing example, the calculated F-value of 4.178 did not exceed the critical value of 4.26, leading to acceptance of the null hypothesis that different prices produce equivalent sales. A non-significant ANOVA result indicates that group means are not statistically different from each other.
π§ Quick Revision Questions
- When should a researcher use ANOVA instead of a t-test or z-test?
- What are the three types of sum of squares in one-way ANOVA, and what does each represent?
- How is the F-ratio calculated in one-way ANOVA, and what do the numerator and denominator represent?
- In the shampoo pricing example, why was the null hypothesis accepted even though the group means (9.75, 12.75, and 11) appeared different?
- What are the degrees of freedom for the numerator and denominator when testing one factor with 4 categories and 5 observations per category?