Skip to the content

Topics Covered

Scatter Diagram Fitting Straight Line Polynomial & Power Curves R² & Equation FORECAST & TREND Data Analysis ToolPak t-test One-way ANOVA p-value
On this page
  1. 1. Scatter Diagram
  2. 2. Fitting Curves with a Trendline
  3. 3. Predicting Future Values: FORECAST and TREND
  4. 4. The Data Analysis ToolPak
  5. 5. Student's t-test using the ToolPak
  6. 6. One-way Analysis of Variance (ANOVA) using the ToolPak
  7. 7. The p-value and its Interpretation
  8. Key Take-aways from Unit 3

1. Scatter Diagram

DEFINITION

A scatter diagram plots paired observations \((x_i, y_i)\) as points on the coordinate plane. It reveals the direction (positive / negative), form (linear / curved) and strength of the relationship between two variables.

In Excel: select the two columns → Insert → Scatter (X Y) → choose "Scatter with only markers".

X Y trendline
EXAMPLE 1

Hours studied vs marks for 7 students shows points rising left-to-right → a positive relationship.

EXAMPLE 2

Price vs quantity demanded shows points falling left-to-right → a negative relationship.

2. Fitting Curves with a Trendline

PROCEDURE

Right-click any point on a scatter chart → Add Trendline → choose the type, and tick "Display Equation on chart" and "Display R-squared value on chart".

2.1 Straight line (linear)

\[ y = a + bx \]

fitted by least squares; \(b\) is the slope, \(a\) the intercept. (Equivalent Excel functions: SLOPE(y,x), INTERCEPT(y,x), or LINEST.)

2.2 Polynomial

\[ y = a_0 + a_1 x + a_2 x^2 + \cdots + a_k x^k \]

choose the order \(k\) (2 = quadratic, 3 = cubic). Higher order fits more wiggles but risks over-fitting.

2.3 Power curve

\[ y = a\,x^{b} \quad\Longleftrightarrow\quad \log y = \log a + b\log x \]

linear in the logs, so it is fitted by least squares on \(\log x, \log y\). Requires all \(x,y > 0\).

2.4 Reading R² and the equation

COEFFICIENT OF DETERMINATION

\(R^2 \in [0,1]\) is the proportion of variation in \(y\) explained by the fitted curve. \(R^2 = 1\) means a perfect fit; \(R^2\) near 0 means the curve explains little. Compare candidate curves and pick the one with the highest \(R^2\) that is not over-fitted.

EXAMPLE 1 — Linear trendline

Advertising spend \(x\) (₹'000): 2, 4, 6, 8, 10; Sales \(y\) (₹'000): 15, 23, 28, 36, 43. Excel's linear trendline displays \(y = 3.4x + 8.5\) with \(R^2 = 0.992\) — a very strong linear fit; each extra ₹1,000 of ads is associated with ₹3,400 more sales.

EXAMPLE 2 — Choosing a curve

For growth data that curves upward, a linear trendline gives \(R^2 = 0.95\) but a 2nd-order polynomial gives \(R^2 = 0.998\). The polynomial fits better, so its displayed equation \(y = 0.5x^2 + 1.2x + 3\) is preferred for prediction within the data range.

3. Predicting Future Values: FORECAST and TREND

FUNCTIONS
EXAMPLE 1

Using the advertising data above, =FORECAST.LINEAR(12, y-range, x-range) predicts sales for ₹12,000 spend: \(3.4\times 12 + 8.5 = 49.3\) → ₹49,300.

EXAMPLE 2

=TREND(B2:B6, A2:A6, {11;12;13}) returns the fitted sales for the next three spend levels at once, useful for filling a forecast column.

4. The Data Analysis ToolPak

ENABLING THE TOOLPAK

It is an Excel add-in: File → Options → Add-ins → Manage: Excel Add-ins → Go → tick Analysis ToolPak → OK. A Data Analysis button then appears on the Data tab.

It provides ready-made statistical procedures: Descriptive Statistics, Histogram, Correlation, Regression, t-tests, F-test, ANOVA (one- and two-way), and more — each via a dialog box, no formulas required.

5. Student's t-test using the ToolPak

WHICH t-TEST?
TWO-SAMPLE t STATISTIC (equal variances) \[ t = \frac{\bar x_1 - \bar x_2}{s_p\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}},\qquad s_p^2 = \frac{(n_1-1)s_1^2 + (n_2-1)s_2^2}{n_1+n_2-2} \]

Procedure: Data → Data Analysis → t-Test… → select the two input ranges, set the hypothesised mean difference (usually 0) and \(\alpha\) (0.05) → OK. The output reports \(t\)-stat, df, one- and two-tail \(p\)-values and critical \(t\).

EXAMPLE 1 — Two independent groups

Yields under two fertilisers: A = 20, 22, 19, 24, 25; B = 28, 26, 30, 27, 29. The ToolPak two-sample t-test (equal variances) returns \(t = -4.7\), two-tail \(p = 0.0015\). Since \(p < 0.05\), the mean yields differ significantly — B is higher.

EXAMPLE 2 — Paired

Blood pressure before and after a drug for 6 patients: the paired t-test returns \(t = 3.2\), \(p = 0.024\) → significant reduction at the 5% level.

6. One-way Analysis of Variance (ANOVA) using the ToolPak

WHEN TO USE

One-way ANOVA compares the means of three or more groups simultaneously, testing \(H_0: \mu_1 = \mu_2 = \cdots = \mu_k\) against the alternative that at least one mean differs.

F STATISTIC \[ F = \frac{\text{MST}}{\text{MSE}} = \frac{\text{SST}/(k-1)}{\text{SSE}/(N-k)} \]

Reject \(H_0\) if \(F > F_{\alpha}(k-1, N-k)\) or equivalently if \(p < \alpha\).

Procedure: arrange each group in its own column → Data → Data Analysis → Anova: Single Factor → select the range, set \(\alpha\) → OK. The output gives the ANOVA table (SS, df, MS, F, \(p\)-value, F-crit).

EXAMPLE 1

Marks under three teaching methods (each n = 5). The ToolPak returns \(F = 6.84\), \(p = 0.011\). Since \(p < 0.05\), the methods differ significantly in mean marks.

EXAMPLE 2

Three machines' output: \(F = 1.9\), \(p = 0.19 > 0.05\) → do not reject \(H_0\); no significant difference between the machines.

7. The p-value and its Interpretation

DEFINITION

The \(p\)-value is the probability, assuming \(H_0\) is true, of obtaining a test statistic at least as extreme as the one observed. It measures the strength of evidence against \(H_0\).

DECISION RULE
Common misreadings to avoid: the \(p\)-value is not the probability that \(H_0\) is true, and a small \(p\) does not measure the size of an effect — only the strength of evidence against \(H_0\). Always report the effect size alongside the \(p\)-value.
EXAMPLE 1

\(p = 0.011\) at \(\alpha = 0.05\): reject \(H_0\). Interpretation: if the groups truly had equal means, a difference this large would occur only about 1.1% of the time — strong evidence of a real difference.

EXAMPLE 2

\(p = 0.19\): do not reject \(H_0\). A difference this large (or larger) would happen 19% of the time by chance even if the means were equal — too common to call significant.

Key Take-aways from Unit 3