Week 07

Week 07 · Marketing Research & Analytics

Hypothesis Testing and Group Differences

Davood Wadi, PhD

Hypothesis testing assesses whether a difference observed in a sample is likely to exist in the population.

From Sample to Population

A difference between two groups in a sample does not necessarily indicate a difference in the population.

Samples vary by chance, so that two samples drawn from the same population produce different results.

A population of 48 customers with a mean monthly spending of 63 dollars. Two samples of eight are drawn from it: their means are 65 and 58 dollars, a difference of 7 dollars. After 43 pairs of samples, the differences between sample means scatter on both sides of zeroPOPULATIONMEAN $63 · PARAMETERSAMPLE 1 · MEAN$65SAMPLE 2 · MEAN$58DIFFERENCE · STATISTIC+$7DIFFERENCE BETWEEN THE TWO MEANS · 43 PAIRS OF SAMPLESSIMULATED−$30−$20−$10$0+$10+$20+$30

A population parameter is a characteristic of the population, such as the true mean satisfaction of all customers. A sample statistic is the corresponding value calculated from a sample.

Statistical inference is the procedure by which conclusions about population parameters are drawn from sample statistics.

Hypothesis testing is the form of inference that assesses whether an observed difference or association can reasonably be attributed to chance.

Null and Alternative Hypotheses

The null hypothesis, denoted H0, states that there is no difference or no association in the population.

The alternative hypothesis, denoted H1, states that a difference or association exists.

For example, H0 states that loyalty program members and nonmembers have the same mean monthly spending. H1 states that their mean monthly spending differs.

The test assesses the evidence against the null hypothesis. The null hypothesis is either rejected or not rejected; it is never proven true.

A two-tailed test examines a difference in either direction. A one-tailed test examines a difference in a direction specified in advance, such as members spending more than nonmembers.

Two lines of the difference in mean monthly spending between members and nonmembers. On each, H0 is the point of no difference. In a two-tailed test, H1 extends in both directions, members spending less or more; in a one-tailed test, H1 extends only towards members spending moreTWO-TAILED TESTMEMBERS SPEND MOREMEMBERS SPEND LESSH1H1H0NO DIFFERENCEONE-TAILED TESTMEMBERS SPEND MOREH1H0NO DIFFERENCE

The Hypothesis Testing Procedure

  1. The researcher first formulates the null and alternative hypotheses.

  2. The researcher then selects the appropriate statistical test.

  3. The researcher then specifies the significance level, conventionally 0.05.

  4. The researcher then collects the data and calculates the test statistic.

  5. The researcher then determines the p-value associated with the test statistic.

  6. The researcher then compares the p-value with the significance level, and rejects the null hypothesis if the p-value is smaller.

  7. Finally, the researcher states the conclusion in terms of the marketing research problem.

Exercise · Put it in order

Does satisfaction differ between a streaming service's annual and monthly plans? Order the steps.

Tap a step, then the number where it belongs.

The p-Value and the Significance Level

The p-value is the probability of obtaining a result at least as extreme as the one observed, assuming that the null hypothesis is true.

A small p-value indicates that the observed result would be unlikely if the null hypothesis were true.

The significance level, denoted alpha, is the threshold below which the p-value leads to the rejection of the null hypothesis.

The p-value is not the probability that the null hypothesis is true, and it is not the probability that the result occurred by chance.

The distribution of the test statistic if the null hypothesis were true. The observed test statistic is 2.05; the shaded tails beyond it on both sides give p = 0.04, below the significance level of 0.05, so the null hypothesis is rejectedIF H0 WERE TRUEOBSERVED0−1.96+1.96TEST STATISTIC0.05 THRESHOLD0.05 THRESHOLDp = 0.04BELOW 0.05 · H0 REJECTED

A p-value of 0.04 and a p-value of 0.06 represent very similar strength of evidence, although only the first falls below the conventional threshold.

Type I and Type II Errors

A Type I error occurs when the null hypothesis is rejected although it is true, so that a difference is reported that does not exist in the population. When the null hypothesis is true, the probability of a Type I error equals the significance level.

A Type II error occurs when the null hypothesis is not rejected although it is false, so that a real difference is not detected.

The power of a test is the probability of correctly rejecting a false null hypothesis. Power increases with the sample size and with the size of the true difference.

For example, concluding that a new advertisement increases purchase intention when it does not is a Type I error, and may lead the firm to spend its budget on an ineffective campaign. Failing to detect a real improvement is a Type II error, and may lead the firm to abandon an effective campaign.

For a given sample size, reducing the probability of one type of error increases the probability of the other.

Two distributions of the test statistic: if H0 is true, and if H1 is true with a true difference of 0.2 standard deviations and 200 respondents per group. With the critical value at 1.65, the probability of a Type I error is 5%, of a Type II error 36%, and the power is 64%IF H0 IS TRUEIF H1 IS TRUEH0 NOT REJECTEDH0 REJECTEDTEST STATISTICTYPE I ERROR5%TYPE II ERROR36%POWER64%
Respondents per group
Exercise · Sort into groups

In each case, the truth about the population is known afterwards. Sort each conclusion by the type of error it contains.

      Tap a card, then tap the group it belongs to.

      Part 2: Tests of Group Differences

      The appropriate test depends on the level of measurement of the variables, the number of groups compared, and whether the groups consist of different or the same respondents.

      Tests of means are used for interval and ratio variables.

      Tests of frequencies are used for nominal variables.

      Nonparametric tests, such as the Mann-Whitney U test and the Wilcoxon signed-rank test, are used for ordinal variables.

      The Independent-Samples t-Test

      The independent-samples t-test compares the means of an interval or ratio variable between two groups of different respondents.

      For example, it tests whether the mean monthly spending of loyalty program members differs from that of nonmembers.

      The test statistic, t, is the difference between the two sample means divided by the standard error of that difference.

      A larger difference between the means, less variation within the groups, and larger samples each produce a larger value of t and a smaller p-value.

      Monthly spending of 40 members and 40 nonmembers. Members spend 10 dollars more on average, with a standard deviation of 25 dollars within each group. The standard error of the difference is 5.59 dollars, so t is 1.79 and p = 0.08t = DIFFERENCE BETWEEN THE MEANS ÷ ITS STANDARD ERROR$10 ÷ $5.59t = 1.79p = 0.08MEMBERSNONMEMBERSDIFFERENCE$0$40$80$120$160$200
      10
      25
      40

      The Paired-Samples t-Test

      The paired-samples t-test compares two means obtained from the same respondents.

      It is used when respondents are measured twice, as in ratings of a brand before and after exposure to an advertisement.

      It is also used when the same respondents rate two objects, as in ratings of two package designs.

      Because the comparison is made within each respondent, the test removes variation between respondents and detects smaller differences than the independent-samples test.

      Twelve respondents rate a brand from 0 to 100 before and after an advertisement; every rating rises by 4 to 7 points, 5 on average. Analysed as two independent groups, the rise is small beside the spread between respondents: t = 0.57, p = 0.58BEFORE THE ADAFTER THE AD20406080100RATINGMEANDIFFERENCE IN MEANS+5INDEPENDENT t-TESTt = 0.57p = 0.58
      Analyse as

      Analysis of Variance

      One-way analysis of variance, known as ANOVA, compares the means of an interval or ratio variable across three or more groups.

      For example, it tests whether mean satisfaction differs among customers who shop online, in store, and through a mobile application.

      The F statistic compares the variation between the group means with the variation within the groups.

      Satisfaction of fifteen customers in each of three channels: online, in store and in the mobile application, with means of 52, 60 and 64 in both panels. With little variation within the groups, F is 35.0 (p < 0.001); with much variation within the groups, F is 2.9 (p = 0.07)LITTLE VARIATION WITHIN GROUPS20406080100BETWEENF = 35.0p < 0.001WITHINMUCH VARIATION WITHIN GROUPS20406080100BETWEENF = 2.9p = 0.07WITHIN

      A significant F statistic indicates that at least one group mean differs from the others, but not which one.

      Post hoc tests then identify which pairs of groups differ, while controlling the overall probability of a Type I error.

      The Chi-Square Test

      The chi-square test assesses whether two nominal variables in a cross-tabulation, introduced in Week 6, are associated in the population.

      It compares the observed frequency in each cell with the frequency expected if the two variables were unrelated. For example, it tests whether preferred shopping channel is associated with age group.

      Preferred shopping channel by age group, 100 respondents per age group. Observed and expected frequencies: aged 18–34, 45 observed against 33.3 expected, 25 observed against 40.0 expected, 30 observed against 26.7 expected; aged 35–54, 33 observed against 33.3 expected, 40 observed against 40.0 expected, 27 observed against 26.7 expected; aged 55+, 22 observed against 33.3 expected, 55 observed against 40.0 expected, 23 observed against 26.7 expected. Chi-square is 20.1, p < 0.001TOTAL18–3445EXPECTED33.325EXPECTED40.030EXPECTED26.710035–5433EXPECTED33.340EXPECTED40.027EXPECTED26.710055+22EXPECTED33.355EXPECTED40.023EXPECTED26.710010012080300TOTALχ² = 20.1p < 0.001

      The larger the discrepancies between observed and expected frequencies, the larger the chi-square statistic and the smaller the p-value.

      The test requires an adequate expected frequency in each cell, conventionally at least five.

      Selecting a Test

      1. To compare the means of two groups of different respondents, the independent-samples t-test is used.

        Two groups of different respondents
      2. To compare two means obtained from the same respondents, the paired-samples t-test is used.

        The same respondents, each measured twice
      3. To compare the means of three or more groups, analysis of variance is used.

        Three groups of different respondents
      4. To assess the association between two nominal variables, the chi-square test is used.

        A cross-tabulation of two nominal variables
      5. To compare two groups on an ordinal variable, a nonparametric test such as the Mann-Whitney U test is used.

        Two groups of respondents placed in rank order253164
      Exercise · Which one is it?

      Each case describes a comparison a marketing analyst wants to test. Name the test to use.

      Each of 150 panel members rates a hotel brand from 0 to 100 before and after watching its new commercial.

      Which concept does this case show?

      Discussion: Testing a Loyalty Program

      Discussion: A grocery chain reports that members of its loyalty program spend on average 18 percent more per month than nonmembers, and the difference is statistically significant. Which hypotheses were tested, which test was appropriate, and does the result establish that the program increases spending?

      Part 3: Statistical and Practical Significance

      A statistically significant result indicates that the observed difference would be unlikely if no difference existed in the population.

      It does not indicate that the difference is large or that it matters for the decision.

      Researchers therefore report the size of the difference in addition to its statistical significance.

      Statistical Versus Practical Significance

      With a sufficiently large sample, very small differences become statistically significant.

      For example, in a test with two million website visitors divided equally between two versions of a page, a conversion rate of 3.05 percent for one version and 3.00 percent for the other is statistically significant at the 0.05 level.

      Two versions of a web page convert 3.05 and 3.00 percent of visitors. With 2,000,000 visitors divided equally between them, p = 0.04: statistically significant at the 0.05 level. The p-value falls as the number of visitors grows and crosses 0.05 at about 1.8 million, while the difference stays at 0.05 percentage pointsCONVERSION RATE3.05%A3.00%Bp-VALUE0.010.250.510.05100,0001 MILLIONVISITORS IN THE TESTp = 0.042,000,000 VISITORS

      Practical significance is the extent to which a difference is large enough to affect a marketing decision.

      Whether a difference is practically significant depends on the costs and benefits of acting on it, such as the cost of implementing the new page relative to the additional revenue it produces.

      Conversely, a large and practically important difference may fail to reach statistical significance in a small sample.

      Effect Size

      An effect size measures the magnitude of a difference or association, independently of the sample size.

      For a difference between two means, Cohen's d is the difference between the means divided by their pooled standard deviation. Values of d of approximately 0.2, 0.5, and 0.8 are conventionally described as small, medium, and large, although the importance of an effect depends on the context.

      Two groups' distributions whose means differ by 0.5 pooled standard deviations, a medium effect by convention. The two distributions overlap heavilyDIFFERENCE BETWEEN THE MEANSONE POOLED STANDARD DEVIATIONd = 0.5MEDIUM
      Cohen's d

      For differences between proportions, the effect size can be expressed as the difference in percentage points or as the ratio between the proportions.

      Effect sizes allow findings to be compared across studies with different sample sizes.

      Knowledge Check

      Two studies test a redesigned checkout. Study A (40,000 customers) finds a significant difference with Cohen's d = 0.05. Study B (60 customers) finds d = 0.60, not significant. Which statement is correct?

      Confidence Intervals

      A confidence interval, which extends the margin of error introduced in Week 5, reports a range of plausible values for a population parameter, such as a difference between two means.

      A 95 percent confidence interval for a difference in mean spending of 8 to 22 dollars indicates both the likely size of the difference and the uncertainty of the estimate.

      If a 95 percent confidence interval for a difference excludes zero, the difference is statistically significant at the 0.05 level.

      A 95 percent confidence interval for the difference in mean spending from $8 to $22, centred on $15. It excludes zero, p < 0.001NO DIFFERENCE$8$2295% CONFIDENCE INTERVAL−$10$0$10$20$30DIFFERENCE IN MEAN SPENDINGp < 0.001EXCLUDES ZERO · SIGNIFICANT AT 0.05

      Confidence intervals are therefore more informative than p-values alone, and are reported together with them.

      Part 4: Research Integrity

      The validity of hypothesis testing depends on how the tests are conducted and reported.

      A number of published findings in psychology and consumer research have failed to replicate when other researchers repeated the studies.

      Among the causes identified are analytical practices that increase the probability of Type I errors.

      Questionable Research Practices

      1. p-Hacking is the practice of analyzing the data in several ways and reporting only the analyses that produce statistically significant results.

      2. Examples include removing outliers only after examining the results, testing many outcome variables and reporting only the significant ones, and adding respondents until the result becomes significant.

      3. Selective reporting of subgroups is the practice of testing the effect in many segments and presenting only the segments in which it is significant.

      4. HARKing, or hypothesizing after the results are known, is the practice of presenting a hypothesis formulated after examining the data as if it had been formulated in advance.

      Each practice increases the probability of reporting a difference that does not exist in the population.

      One hundred simulated studies of a difference that does not exist. With one planned test, 5 of the 100 report a statistically significant difference100 STUDIES · NO DIFFERENCE EXISTSSIMULATED5OF 100 REPORTp < 0.05
      Practices

      Multiple Comparisons

      Each test conducted at a significance level of 0.05 has a five percent probability of producing a Type I error when the null hypothesis is true.

      When many tests are conducted, the probability that at least one produces a Type I error increases rapidly.

      With 20 independent tests of true null hypotheses, the probability of at least one statistically significant result is approximately 64 percent.

      20 tests of true null hypotheses at a level of 0.05 per test. In this simulated run 1 of the 20 tests is significant. The probability of at least one significant result is 64 percent20 TESTS · NO REAL DIFFERENCESLEVEL PER TEST 0.05 · SIMULATED.014AT LEAST ONE SIGNIFICANT RESULT0%50%100%110203040NUMBER OF TESTS64%
      20
      Correction

      The Bonferroni correction divides the significance level by the number of tests, so that 20 tests are each conducted at a level of 0.0025.

      Reports that present many significance tests, such as comparisons across numerous customer segments, state how many tests were conducted and whether a correction was applied.

      Preregistration and Reproducible Analysis

      Preregistration is the documentation of the hypotheses, sample size, exclusion criteria, and analysis plan before the data are collected.

      It distinguishes confirmatory analyses, which test hypotheses specified in advance, from exploratory analyses, which generate hypotheses for future testing.

      Before the data are collected, a preregistration document lists the hypotheses, sample size, exclusion criteria and analysis plan. The data are then collected from respondents. Confirmatory analyses test the preregistered hypotheses; exploratory analyses generate new ideas, which become hypotheses for a future preregistered studyPREREGISTRATIONHYPOTHESESSAMPLE SIZEEXCLUSION CRITERIAANALYSIS PLANBEFORE THE DATA ARE COLLECTEDAFTERDATA COLLECTIONCONFIRMATORYHYPOTHESES SPECIFIED IN ADVANCEEXPLORATORYFUTURE TESTING

      In commercial research, the equivalent practice is an analysis plan agreed with the client before data collection.

      Reproducible analysis is conducted with documented code, so that another analyst can obtain the same results from the same data.

      Complete reporting states every test conducted, including those that did not produce significant results.

      Exercise · Which one is it?

      Each case describes something a research team does. Name the practice.

      Before fieldwork begins, the team files a dated document stating its hypothesis, a sample of 600, the rule for excluding speeders and the test it will run.

      Which concept does this case show?

      Hypothesis Testing in AI Evaluation

      Comparisons of AI models and prompts are hypothesis tests, in which the responses to each model or prompt form a sample.

      A t-test compares two models or prompts, and analysis of variance compares several, with each response as an observation.

      Because additional responses cost little, very large samples are easily obtained, and very small differences become statistically significant. Effect sizes and confidence intervals therefore accompany every test.

      Evaluations that compare many models, prompts, and products involve many tests at once, and the corrections for multiple comparisons introduced in this week apply.

      8 AI models, each pair compared on six products: 28 pairs and 168 tests. If no model differed from any other, about 8.4 tests would still be significant at the 0.05 level; the Bonferroni level per test is 0.00030PAIRS OF MODELS28× 6 PRODUCTSTESTS168SIGNIFICANT BY CHANCE AT 0.05IF NO MODEL DIFFERS≈ 8.4BONFERRONI LEVELPER TEST0.0003
      8

      Claims that a newer model performs better are tested rather than assumed. In one evaluation, newer model generations were more susceptible to anchoring in price judgments than older generations (Wadi & Fredette, 2025).

      Knowledge Check

      A team tests every pair of 12 prompt wordings, with 20,000 responses per wording. One pair differs significantly (p = 0.03): mean ratings of 5.61 and 5.58 on a seven-point scale. What should the team add before concluding?

      Reproducibility of AI Evaluations

      Providers update their models frequently, and a model with the same name may behave differently some months later.

      A reproducible evaluation records the exact model version, the date, the generation settings, the complete prompts, and the number of responses per condition.

      A record sheet for one AI evaluation: the exact model version gpt-4.1-2025-04-14, the date 2025-06-12, the generation settings of temperature 1.0 and 300 maximum tokens, the complete prompt text, and 100 responses per conditionMODEL VERSIONgpt-4.1-2025-04-14DATE2025-06-12GENERATION SETTINGStemperature 1.0 · max tokens 300COMPLETE PROMPTSRESPONSES PER CONDITION100

      The hypotheses, measures, and analyses are preregistered before the responses are collected, as for research with human participants.

      The prompts, responses, and analysis code are retained, so that the evaluation can be repeated on newer models with the same design.

      Discussion: Twenty Segments

      Discussion: An analyst tests whether a new loyalty offer increased spending in each of 20 customer segments and finds a statistically significant increase in one segment. The marketing director proposes to extend the offer to that segment immediately. How should this result be interpreted, and what further evidence should be obtained before the decision is taken?

      Key Takeaways

      1. Hypothesis testing assesses whether a sample result provides sufficient evidence against the null hypothesis of no difference or no association.

      2. The p-value is the probability of a result at least as extreme as the one observed if the null hypothesis were true, and not the probability that the null hypothesis is true.

      3. Type I errors report differences that do not exist; Type II errors fail to detect differences that do exist.

      4. The t-test compares two means, analysis of variance compares three or more means, and the chi-square test assesses the association between two nominal variables.

      5. Statistical significance does not establish practical significance, and effect sizes and confidence intervals are reported together with p-values.

      6. p-Hacking, selective reporting, and uncorrected multiple comparisons increase false findings, while preregistration and reproducible analysis protect against them.

      7. Comparisons of AI models and prompts are hypothesis tests that require effect sizes, corrections for multiple comparisons, and complete records of model versions and prompts.