…
…
Statistics and Data Analysis Fundamentals · Lesson 35 / 44 · Inference with formulas
PreviewIn this lesson you will
You can read the explanation without an account. The exercises and quiz at the end of the lesson are for members.
It is the first week of your internship at a data consultancy. Five short questions from five different clients have landed on your desk. None of them is about Bazaar, and none tells you which test to use, so you will choose the method by reading the question and the data.
This is a practice lesson: there is no new tool. In lessons 27–30 you measured the role of chance by simulation. In lessons 31 and 32 you did the same job with formulas (proportions and means). In lesson 33 you saw how a decision can go wrong, and in lesson 34 you looked at the relationship between two categorical variables. In every one of those lessons the question was clear: "this lesson is about chi-square, so I will run a chi-square." In real work, nobody tells you the name of the method. The client sends only a question and a file. An analyst's first job is to read the question and choose the right tool. A perfect calculation with the wrong tool still gives the wrong result.
The data in this lesson is fictional sample data: we made four files ourselves (the call durations of a call center, a notification experiment for an app, apartment rental listings, and the daily rentals of a city bike system). The numbers are realistic, but they do not come from a real organization.
In this lesson you will:
Choosing a method is not memorizing. You answer four questions in order. The first is the type of the outcome variable: is the thing you measured a number (minutes, dollars, a score) or a category (yes/no, neighborhood, carrier)? With a numeric outcome you work with means. With a categorical outcome you work with proportions or count tables. The second question is how many groups there are: are you comparing one group with a target value (is the return rate above 5%?), two groups with each other (A and B), or looking at the relationship between two categorical variables (category and status)? The third question is whether the groups are independent: are the two groups made of different units, or were the same units measured twice? The fourth question is whether the data is very skewed and how large n is: in a numeric outcome, strong skew means the mean no longer represents a typical value (lesson 12), and together with a small n it also breaks the condition of the t formula (lesson 32).
These are the boxes on the map: one proportion (lesson 31: binomtest, proportion_confint), two proportions (lesson 31: proportions_ztest, confint_proportions_2indep), one mean (lesson 32: ttest_1samp), two means (lesson 32: ttest_ind(..., equal_var=False), which is Welch's test), and two categorical variables (lesson 34: chi2_contingency). In this lesson we add three more boxes marked "Advanced": paired data, a rank-based comparison, and three or more groups.
Writing the map as a small function makes it easier to see that the questions really are asked in order. The function checks independence first, because two measurements of the same units go down a separate path whatever their type. Then come the type of the outcome and the number of groups. Here are two familiar questions from Bazaar and the question from lesson 34:
Example 1 (a reminder from Bazaar): Turning the map into a function
def choose_method(outcome, groups, independent=True): if not independent: return "paired" if outcome == "categorical" and groups == 1: return "one_proportion" if outcome == "categorical" and groups == 2: return "two_proportions" if outcome == "two_categorical": return "chi_square" if groups == 1: return "one_mean" return "two_means" print("Is the return rate above 5%?", choose_method("categorical", 1)) print("Do Arrow Express and Caravan Freight differ in satisfaction?", choose_method("numeric", 2)) print("Are category and order status related?", choose_method("two_categorical", 1))
OutputIs the return rate above 5%? one_proportion
Do Arrow Express and Caravan Freight differ in satisfaction? two_means
Are category and order status related? chi_squareA return is a yes/no outcome and there is one group (all orders) with a target of 5%: one proportion. Satisfaction is a score from 1 to 5 and there are two carriers: two means. Category and status are two categorical variables: chi-square. This function is not a full decision machine (it does not ask about skew or n), but it shows the logic of the order. The most common mistake is this: "Every comparison is a t test." A t test only tests the mean of a numeric outcome. If the outcome is yes/no, you go to a proportion test. If there are two categorical variables, you go to chi-square. The choice comes from the type of the outcome, not from the size of the data.
Match each client question with the right method.
For each row, pick its match from the list, then check.
The order of the four questions is not random. Without knowing the type of the outcome, the number of groups means nothing (two groups, but proportions or means?). Independence is asked after the number of groups is known: do the two groups consist of the same units? Skew and n come last, because they only matter for a numeric outcome and only once the method box is known: "does this box's condition hold?"
Put the questions you ask when choosing a method in the right order.
Click the lines in order; to undo one you placed wrong, click it in the list below.
Shuffled lines
Your order
In every case you will follow the same four sub-steps, and in the exercises your code will come with the same four headings: # 1. Read the question, # 2. Condition, # 3. Run, # 4. One sentence. The fourth step is the one people skip most often, yet it is the only thing the client will read.
The first client is a call center. The manager wants to write "our average call time does not exceed 6.5 minutes" in a tender document, and sent the durations of 500 randomly selected calls. Read the question: the outcome is numeric (minutes), there is one group and a target value (6.5): one mean. Condition: the calls are independent and randomly selected; n = 500 is large, and if the skew is low, the t formula works comfortably. Run: ttest_1samp and the interval.
Example 2 (outside the case): Is call time below 6.5 minutes?
import pandas as pd from scipy import stats calls = pd.read_csv("call_durations.csv") duration = calls["duration_min"] print("n:", len(duration), "| mean:", round(duration.mean(), 2), "| median:", duration.median()) print("skew:", round(duration.skew(), 2)) result = stats.ttest_1samp(duration, 6.5) ci = result.confidence_interval() print("t =", round(result.statistic, 2), "| p =", f"{result.pvalue:.1e}") print("95% interval:", round(ci.low, 2), "-", round(ci.high, 2))
Outputn: 500 | mean: 6.15 | median: 6.1
skew: 0.0
t = -5.26 | p = 2.1e-07
95% interval: 6.02 - 6.28The skew is almost zero, and the mean and the median are very close (6.15 and 6.1): the distribution is symmetric, so the condition holds. f"{result.pvalue:.1e}" writes a very small number in scientific notation: 2.1e-07, which is 0.00000021. With t = −5.26, the sample mean is 5.26 standard errors below 6.5. If the true mean were 6.5, a gap like this would almost never happen. The interval runs from 6.02 to 6.28 minutes and does not contain 6.5; the test and the interval say the same thing, as in lesson 30.
One sentence: "Calls last 6.15 minutes on average (95% interval 6.02–6.28), which is clearly below 6.5 minutes." The sentence has no t and not even a p: the client reads the number, its unit and the uncertainty. If a p value is asked for, you give it in parentheses. The manager's sentence ("does not exceed 6.5") fits the data, but it is a sentence about the mean; the question below tests exactly this difference.
The 95% interval for the mean is 6.02–6.28 minutes. Do about 95% of individual calls last between these two values?
The second client is a mobile app. They split their users randomly into two groups: one group received a personalized notification (1,974 users), and the other received the old generic notification (control, 2,026 users). The primary metric: whether the user comes back to the app within 7 days. The client sent summary numbers instead of the raw file; remember from lesson 31 that proportion tests only need the counts.
Read the question: the outcome is yes/no (came back or not), two independent groups: two proportions. Condition: there is random assignment, and the success and failure counts in each group are much larger than 10 (674 and 1,300; 619 and 1,407). Run: proportions_ztest and the interval for the difference. Product teams also track a guardrail metric next to the primary metric: a measure that shows whether the experiment broke something. Here the guardrail metric is the share of users who turned notifications off.
Example 3 (outside the case): Did the personalized notification increase returns?
from statsmodels.stats.proportion import proportions_ztest, confint_proportions_2indep n = {"personalized": 1974, "control": 2026} returned = {"personalized": 674, "control": 619} muted = {"personalized": 136, "control": 77} for group in n: print(group, "| returned:", round(returned[group] / n[group] * 100, 1), "| muted:", round(muted[group] / n[group] * 100, 1)) z, p = proportions_ztest([returned["personalized"], returned["control"]], [n["personalized"], n["control"]]) low, high = confint_proportions_2indep(returned["personalized"], n["personalized"], returned["control"], n["control"]) print("Returned: z =", round(z, 2), "| p =", round(p, 3), "| difference interval:", round(low * 100, 1), "-", round(high * 100, 1), "points") z, p = proportions_ztest([muted["personalized"], muted["control"]], [n["personalized"], n["control"]]) print(, (z, 2), , f)
Outputpersonalized | returned: 34.1 | muted: 6.9
control | returned: 30.6 | muted: 3.8
Returned: z = 2.43 | p = 0.015 | difference interval: 0.7 - 6.5 points
Muted: z = 4.35 | p = 1.4e-05The return rate went from 30.6% to 34.1%: about 3.6 points. With p = 0.015, a difference this large would rarely appear if there were no real difference. The interval is 0.7 to 6.5 points: the difference is above zero, but it may be small or large. With the trio from lesson 33: is there a difference (most likely yes), how big is it (0.7–6.5 points), does it matter (the product team decides). The guardrail metric tells a different story: the share of users who muted notifications rose from 3.8% to 6.9%, almost doubling, and the difference is too clear to be explained by chance (p = 1.4e-05). You cannot send a notification to a user who turned notifications off.
One sentence: "The personalized notification raised 7-day returns by about 3.6 points (0.7–6.5 points), but the share of users who muted notifications also rose, from 3.8% to 6.9%." This is the only experiment in the lesson: users were assigned to groups at random, so we can write a cause-and-effect sentence such as "the notification increased returns." The other four cases are observational data.
The product manager sees the result: "p = 0.015, significant. Let's roll the personalized notification out to everyone." What do you recommend?
Pick an option and see what happens. There are no points; you can try the other options too.
The third client is a real estate site. They sent 608 apartment rental listings: neighborhood (six neighborhoods), number of bedrooms, area in square meters, whether the apartment is furnished, walking time to the metro, and rent. Their first question: "Does the share of furnished listings change by neighborhood? Are furnished homes more common in some neighborhoods?" Read the question: two categorical variables (neighborhood and furnished): chi-square. The outcome is categorical too; there is no mean here, and a t test does not even come up.
Before the test we look at the row proportions (as in lesson 34): what percent of the listings in each neighborhood are furnished? Answer the question below before looking at the numbers.
The share of furnished listings runs from 22.6% (Old Town) to 35.1% (Riverside) across neighborhoods, with 87–115 listings in each. Is there a relationship between neighborhood and being furnished that chance cannot explain?
Condition: each listing sits in exactly one cell (independent observations), the table holds counts, not proportions, and the expected counts should be at least 5. Run: a count table with pd.crosstab and the test with chi2_contingency.
Example 4 (outside the case): Are neighborhood and being furnished related?
import pandas as pd from scipy import stats listings = pd.read_csv("listings.csv") table = pd.crosstab(listings["neighborhood"], listings["furnished"]) print((pd.crosstab(listings["neighborhood"], listings["furnished"], normalize="index")["yes"] * 100).round(1).sort_values()) result = stats.chi2_contingency(table) print("Smallest expected:", round(result.expected_freq.min(), 1)) print("chi2 =", round(result.statistic, 2), "| df =", result.dof, "| p =", round(result.pvalue, 2))
Outputneighborhood
Old Town 22.6
Harborside 28.7
Midtown 29.7
Southgate 30.1
Eastfield 34.7
Riverside 35.1
Name: yes, dtype: float64
Smallest expected: 26.2
chi2 = 5.48 | df = 5 | p = 0.36The smallest expected count is 26.2: the condition holds with room to spare. The degrees of freedom are (6 − 1) × (2 − 1) = 5. With χ² = 5.48 and p = 0.36, even if there were no real difference between neighborhoods, you would see this much movement or more about one time in three. The 12-point gap your eye saw cannot be told apart from chance with this data.
There is an important mistake here: "A non-significant result says nothing, so it is not worth putting in the report." It does say something. The client's question was "are furnished listings more common in some neighborhoods?" and the answer is "this data could not show it." That sentence may save the client from launching a regional marketing campaign for nothing. But be careful: saying "there is no relationship between neighborhood and being furnished" would be wrong too (lesson 33: a non-significant result does not show that there is no effect). With more listings, a small difference could appear.
One sentence: "The share of furnished listings seems to vary from 22.6% to 35.1% across neighborhoods, but this gap cannot be told apart from chance with this data (p = 0.36); a relationship between neighborhood and being furnished could not be shown."
The same client's second question: "Are furnished apartments more expensive than unfurnished ones?" Read the question: the outcome is numeric (rent, in dollars), two independent groups (different listings): two means. But the fourth question comes into play here: money variables such as rent are usually right-skewed. In the Condition step we first look at the summary statistics: the mean and the median side by side.
Example 5 (outside the case): Mean and median of skewed rent
import pandas as pd from scipy import stats listings = pd.read_csv("listings.csv") print("skew:", round(listings["rent"].skew(), 1), "| highest rent:", listings["rent"].max()) print(listings.groupby("furnished")["rent"].agg(["count", "mean", "median"]).round(0)) yes = listings[listings["furnished"] == "yes"]["rent"] no = listings[listings["furnished"] == "no"]["rent"] result = stats.ttest_ind(yes, no, equal_var=False) ci = result.confidence_interval() print("Welch p =", round(result.pvalue, 3), "| difference interval ($):", round(ci.low), "to", round(ci.high))
Outputskew: 12.3 | highest rent: 29000
count mean median
furnished
no 425 1786.0 1575.0
yes 183 1854.0 1575.0
Welch p = 0.685 | difference interval ($): -260 to 395The skew is 12.3, far above the values you saw in lesson 16 (the Bazaar order amount was 4.18). The highest rent is $29,000 a month; that looks unrealistic for an apartment and is most likely a data entry error (one zero too many). The means are $1,854 and $1,786: furnished apartments look about $67 more expensive on average. The medians, however, are exactly the same: $1,575 and $1,575. A typical furnished apartment and a typical unfurnished apartment have the same rent.
The mistake is this: "In skewed data, the difference in means is the typical difference." It is not. A few extreme listings pull one group's mean upward; the median resists this (lesson 12). Because n is large (183 and 425), Welch's test technically works, and it says that the difference in means can also be explained by chance (p = 0.685; the interval from −$260 to $395 contains zero). But the measure to report is the median, because the client's question is "is a typical furnished apartment more expensive?"
One sentence: "The typical rent of furnished and unfurnished listings is the same (median $1,575); the $67 gap between the means can also be explained by chance (p = 0.69)."
#### Advanced: rank-based comparison (Mann-Whitney)
For skewed data there is a test that does not compare means. It asks: "does a value drawn at random from one group tend to be larger than one from the other group?" This is the Mann-Whitney U test. It sorts all values from smallest to largest and replaces each value with its rank number; then it compares the ranks of the two groups. The $29,000 listing gets the largest rank number, but whether that rank is 609 or 6,090 does not change anything. This is why the effect of an extreme value is small.
import pandas as pd from scipy import stats listings = pd.read_csv("listings.csv") yes = listings[listings["furnished"] == "yes"]["rent"] no = listings[listings["furnished"] == "no"]["rent"] result = stats.mannwhitneyu(yes, no) print("Mann-Whitney p =", round(result.pvalue, 2)) clean = listings[listings["rent"] < 25000] print("Means without the extreme listing:", clean.groupby("furnished")["rent"].mean().round(0).tolist())
OutputMann-Whitney p = 0.92
Means without the extreme listing: [1786.0, 1705.0]Mann-Whitney p = 0.92: the rents of the two groups are ranked in almost the same way. The second line shows the power of a single listing: when we remove the $29,000 listing, the mean of the furnished listings falls from $1,854 to $1,705 and the difference changes direction (furnished listings are now about $82 cheaper). One wrong row can flip the sign of the difference in means, while the median and the rank-based test do not move. We are not cleaning the data in this lesson (cleaning is the subject of lessons 18–21); this is why the median and a rank-based test are the safer choice for this kind of data.
The fourth client is a city's bike-sharing system. They sent the number of rentals for every day of 2024 and 2025, and they ask: "Did usage increase in 2025?" If we compute the daily average rentals for each month of each year, we get 12 months × 2 years = 24 numbers. Read the question: the outcome is numeric, two groups (2024 and 2025). But the third question is critical: are the groups independent? No. January 2024 and January 2025 are the same month; both are winter, both are cold. The same units (months) were measured twice.
This kind of data is called paired data, and its method is simple: for each unit take the difference (2025 − 2024), then test whether the mean of the differences is different from zero. This is really a one-mean test on the differences; the ready-made name in SciPy is ttest_rel ("related").
You will compare the daily average rentals of the same 12 months in 2024 and 2025. Which test fits?
Let's see the wrong path first, then the right one. We take the month and year from the date (lesson 6) and build the month × year table with pivot_table from lesson 8:
Example 6 (outside the case): Independent test and paired test
import pandas as pd from scipy import stats rentals = pd.read_csv("bike_rentals.csv") rentals["date"] = pd.to_datetime(rentals["date"]) rentals["year"] = rentals["date"].dt.year rentals["month"] = rentals["date"].dt.month table = rentals.pivot_table(index="month", columns="year", values="rentals", aggfunc="mean").round(1) table["diff"] = table[2025] - table[2024] print(table.loc[[1, 4, 7, 10]]) print("Mean difference:", round(table["diff"].mean(), 1)) print("Independent t p =", round(stats.ttest_ind(table[2025], table[2024]).pvalue, 2)) print("Paired t p =", round(stats.ttest_rel(table[2025], table[2024]).pvalue, 4))
Outputyear 2024 2025 diff
month
1 866.5 961.9 95.4
4 2095.8 2134.5 38.7
7 2693.2 2798.3 105.1
10 2111.2 2113.7 2.5
Mean difference: 163.0
Independent t p = 0.64
Paired t p = 0.0003The four rows of the table show the reason. The difference between months is huge: about 900 rentals a day in January and 2,700–2,800 in July. The difference between years is small but consistent: 163 more rentals a day on average, and 2025 is higher in all 12 months. The independent test (p = 0.64) treats the large difference between months as "noise," and the gap of 163 gets lost inside that noise. The paired test (p = 0.0003) compares each month with itself, so the seasonal difference drops out of the calculation; what remains is only the difference between years and its small variation.
The mistake: "Two measurements of the same unit are two independent groups." They are not, and the mistake is costly: the same data says "no difference" with the wrong test and "a very clear difference" with the right one. One sentence: "In 2025, daily rentals were higher than in 2024 in every month; the mean difference is 163 rentals per day (paired test, p = 0.0003)." This is observational data: the table does not tell you the cause of the increase (new stations, weather, or price).
The real estate client's third question: "Are the rents in the six neighborhoods different?" The first idea is to compare the neighborhoods two at a time. With six neighborhoods there are 15 pairs. The problem: each test gives a false alarm with a 5% probability (lesson 33). For one test, that is 5%; but if you run many tests, the probability that at least one gives a false alarm adds up. With three independent tests, the probability of at least one false alarm is 1 − 0.95³ ≈ 0.143, about 14%. With 15 tests it goes past one half (Example 8 in the Examples section). Even if no neighborhood is really different, finding a "significant difference between Old Town and Southgate" becomes almost as likely as a coin flip.
The solution is to compare all groups with a single test. ANOVA (analysis of variance) answers the question "is at least one of the group means different from the others?" with a single number, the F ratio. For skewed data, its rank-based counterpart is the Kruskal-Wallis test; you can think of it as Mann-Whitney extended to three or more groups.
Example 7 (outside the case): The rent in six neighborhoods
import pandas as pd from scipy import stats listings = pd.read_csv("listings.csv") print(listings.groupby("neighborhood")["rent"].median().sort_values()) groups = [g["rent"] for _, g in listings.groupby("neighborhood")] f = stats.f_oneway(*groups) kw = stats.kruskal(*groups) print("ANOVA F =", round(f.statistic, 2), "| p =", f"{f.pvalue:.1e}") print("Kruskal-Wallis p =", f"{kw.pvalue:.1e}")
Outputneighborhood
Eastfield 1125.0
Southgate 1300.0
Midtown 1575.0
Riverside 1725.0
Harborside 2025.0
Old Town 2100.0
Name: rent, dtype: float64
ANOVA F = 8.76 | p = 4.9e-08
Kruskal-Wallis p = 1.1e-37The groups list holds the rent series of each neighborhood; *groups unpacks the list and gives each series to the function as a separate input (six neighborhoods, six inputs). The median rent is $1,125 in Eastfield and $2,100 in Old Town. ANOVA gives p = 4.9e-08 and Kruskal-Wallis gives p = 1.1e-37: both tests say "at least one neighborhood is different from the others." The p of Kruskal-Wallis is much smaller because extreme values inflate the noise part of ANOVA, while ranks resist them. But be careful: these tests do not say which neighborhood is different; they only reject the claim "all are the same." To find which pairs differ, there are extra methods that correct for multiple comparisons; they are outside the scope of this course.
The cell below runs the same two tests ready-made. First run it as it is, then write area_m2 instead of rent in two places: do the apartments in different neighborhoods also differ in size?
Try it now· not graded; doesn't affect progress
With area_m2, the medians stay between 93 and 104 m², and both p values are large (0.64 and 0.78): a difference in apartment size between neighborhoods cannot be shown. So the high price of Old Town seems to come from the neighborhood itself, not from larger apartments. "Seems to," because this is observational data too.
Each of the five cases ended with one sentence. The last job is to put these sentences together in one note for the clients. Remember the reporting principles from earlier. The first is answer first: the sentence starts with the answer to the question, not with the name of the method (a client stops reading at the second line of a sentence that starts with "A Welch t test was applied"). The second is state the uncertainty: every number comes with an interval or at least a p value; "the difference is 3.6 points" and "the difference is 0.7–6.5 points" lead to different decisions. The third is language that fits the type of the data: only the notification case is an experiment; in the other cases you do not say "increased" or "caused," you say "higher," "related," "could not be shown." The fourth is a non-significant result is also a finding: the neighborhood and furnished case does not drop out of the report; it goes in as "a relationship could not be shown."
| Case | Method | Reported | Core of the one sentence |
|---|---|---|---|
| Call center | One mean | Mean and interval | 6.15 min (6.02–6.28), below 6.5 |
| Notification experiment | Two proportions | Difference in proportions and interval, guardrail metric | +3.6 points (0.7–6.5), muting 3.8% → 6.9% |
| Neighborhood × furnished | Chi-square | Proportions and p | 22.6%–35.1%, relationship not shown (p = 0.36) |
| Furnished rent | Two means, skewed | Median | Same medians ($1,575) |
| Bikes | Paired (Advanced) | Mean difference and p | +163 rentals a day, higher every month |
A student club asks its members 15 different questions and compares two groups (first-year students and everyone else) with a separate test for each question. If there is really no difference in any question, what is the probability that at least one result comes out "significant"?
for k in [1, 3, 6, 15]: print("tests:", k, "| at least one false alarm:", round(1 - 0.95 ** k, 3))
Outputtests: 1 | at least one false alarm: 0.05
tests: 3 | at least one false alarm: 0.143
tests: 6 | at least one false alarm: 0.265
tests: 15 | at least one false alarm: 0.537Each test carries a 5% risk on its own. The number 0.95 is the probability that one test does not give a false alarm, 0.95^k is the probability that none of k independent tests gives one, and 1 minus that is the probability that at least one does. With 15 tests the probability is 53.7%: seeing at least one "significant difference" in the club's report is more likely than a coin landing heads, even when there is no difference at all. Comparing the six neighborhoods two at a time also makes 15 pairs; this is why the single test of ANOVA comes first.
A tutoring center teaches a study technique to eight students; the same students take an exam of the same difficulty before and after.
from scipy import stats before = [62, 70, 55, 81, 68, 74, 59, 66] after = [66, 73, 57, 84, 70, 79, 60, 70] diff = [b - a for a, b in zip(before, after)] print("Differences:", diff) print("Independent t p =", (stats.ttest_ind(after, before).pvalue, 3)) (, (stats.ttest_rel(after, before).pvalue, 5)) (, (stats.ttest_1samp(diff, 0).pvalue, 5))
Choosing the method by habit instead of by the question. The most common form is running a t test on every comparison: neighborhood and being furnished are two categorical variables (chi-square), returning is a yes/no outcome (two proportions), and the same months of two years are paired data (ttest_rel). In the bike case, the independent t test gives p = 0.64 and says "no difference"; the right test gives p = 0.0003. The fix: before you start calculating, answer the four questions in order (type of the outcome, number of groups, independence, skew and n) and write your choice into the code as method = "..."; writing the choice down makes it easier to question.
Next lesson: So far you have compared groups. But how do two numeric variables change together: when ad spend goes up, do visitors go up too? Scatter plots and correlation.
Exercises and quiz are for members
This lesson has 6 coding exercises and a 10-question quiz. Sign up free to solve them, save your progress and move on to the next lesson.
OutputDifferences: [4, 3, 2, 3, 2, 5, 1, 4]
Independent t p = 0.502
Paired t p = 0.00034
One-sample t on the differences p = 0.00034Every student's score went up by 1 to 5 points, but the differences between students are large (55 to 81). The independent test treats this spread as noise (p = 0.502). The paired test and the one-sample test on the differences give the same p (0.00034): the paired test is exactly a one-mean test on the differences. Still, be careful: this is not an experiment; there is no control group. The scores may have gone up not because of the technique but because of the habit of taking the exam a second time.