---
title: "Fit straight line: humidity and moisture"
subject: "Probability and Statistics"
chapter: 5
key: "semester_5/probability_and_statistics:humidity-moisture-straight-line-fit"
source: https://www.bctengineer.com/q/semester_5/probability_and_statistics/humidity-moisture-straight-line-fit
site: BCT Engineering
---

# Fit straight line: humidity and moisture

Probability and Statistics · Chapter 5: Correlation and regression

- Asked in: 2073 Chaitra, 5 marks
- Video: [Lec-4: Linear Regression📈 with Real life examples & Calculations | Easiest Explanation](https://www.youtube.com/watch?v=zUQr6HAAKp4) — Gate Smashers
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/probability_and_statistics/humidity-moisture-straight-line-fit
- Whole chapter: https://www.bctengineer.com/md/semester_5/probability_and_statistics/chapter-5

## Question

Raw material used in the production of a synthetic fibre is stored in a place which has no humidity control. Measurements of the relative humidity in the storage place and moisture content of sample of the raw material (both in percentage) on 12 days yielded the following results:
| Humidity, X | 42 | 35 | 50 | 43 | 48 | 62 | 31 | 36 | 44 | 39 | 55 | 48 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Moisture content, Y | 12 | 8 | 14 | 9 | 11 | 16 | 7 | 9 | 12 | 10 | 13 | 11 |
Verify that it is reasonable to fit a straight line. Fit the straight by the method of least squares.

## Short answer

A straight line is reasonable because r = 0.9144, and the significance test t = 7.144 exceeds the critical value 2.228. The least squares line is Y = -0.9495 + 0.2690X, so each 1% humidity increase raises moisture content by about 0.269%.

## Answer

Let X = relative humidity (%), Y = moisture content (%), n = 12.

#### Is a straight line reasonable?

Plotting the points (X, Y) gives a scatter that rises from lower-left to upper-right and lies close to a straight band, so a linear model is suitable. This is confirmed numerically by the correlation coefficient:

r = Sxy/√(Sxx·Syy) = **0.9144**  (r² = 0.836)

Test: H₀: ρ = 0 against H₁: ρ ≠ 0, α = 0.05. t = r√(n−2)/√(1−r²) = 7.144, critical value t(0.025, 10) = 2.228. Since 7.144 > 2.228, H₀ is rejected: the linear relationship is significant.

#### Least squares line Y = a + bX

Sums (n = 12):

```text
        x        y       xy       x²       y²
       42       12      504     1764      144
       35        8      280     1225       64
       50       14      700     2500      196
       43        9      387     1849       81
       48       11      528     2304      121
       62       16      992     3844      256
       31        7      217      961       49
       36        9      324     1296       81
       44       12      528     1936      144
       39       10      390     1521      100
       55       13      715     3025      169
       48       11      528     2304      121
---------------------------------------------
      533      132     6093    24529     1526
```

Σx = 533, Σy = 132, Σxy = 6093, Σx² = 24529, Σy² = 1526

Means: x̄ = 44.4167, ȳ = 11.0000

Sxx = Σx² − (Σx)²/n = 854.9167
Sxy = Σxy − (Σx)(Σy)/n = 230.0000
Syy = Σy² − (Σy)²/n = 74.0000

Slope b = Sxy/Sxx = 230.0000/854.9167 = 0.2690
Intercept a = ȳ − bx̄ = 11.0000 − (0.2690)(44.4167) = -0.9495

**Fitted line: Ŷ = -0.9495 + 0.2690 X**

Interpretation: each 1% rise in humidity raises moisture content by about 0.269%.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How is it verified that a straight line is reasonable?
   A. Check that x̄ = ȳ
   B. Check the scatter lies in a rising straight band and r is large (0.914) and significant
   C. Check that n is 12
   D. Check that Σy is large
   Answer: B. A scatter plot close to a straight band plus a high, significant r supports a linear model. (Key point: Checking linearity)

2. The test of r with n = 12 uses critical value:
   A. t(0.025, 12) = 2.179
   B. t(0.025, 11) = 2.201
   C. z = 1.96
   D. t(0.025, 10) = 2.228
   Answer: D. df = n − 2 = 10; since 7.144 > 2.228, reject H0: ρ = 0. (Key point: Significance test of r)

3. Slope b = Sxy/Sxx = 230/854.92 is:
   A. 3.717
   B. 0.914
   C. 0.269
   D. -0.95
   Answer: C. b = 230/854.9167 = 0.2690. (Key point: Slope)

4. Which is right for Ŷ = −0.9495 + 0.269X?
   A. Each 1% rise in humidity raises moisture content by about 0.269%; a = ȳ − b·x̄
   B. Each 1% rise lowers moisture by 0.269%
   C. a = x̄ − b·ȳ
   D. Moisture is 0.269 at zero humidity
   Answer: A. The slope is the change in Y per unit X, and the intercept is ȳ − b·x̄ = 11 − 0.269(44.4167). (Key point: Meaning and intercept)

## Related in Probability and Statistics

- [Sample mean, variance, CV: patients' sleep hours](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Ahospital-patients-sleep-mean-cv) — Probability and Statistics, chapter 1, asked 3×
- [ANOVA: thiamin content of four cereals](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Aanova-cereal-thiamin) — Probability and Statistics, chapter 6
- [Normal: percentage of defective washers](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Awashers-defective-percentage-normal) — Probability and Statistics, chapter 3
- [Three urns; both balls from Urn B](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Aurns-red-black-both-from-b) — Probability and Statistics, chapter 1
- [Fiducial limits for mean, sample of 900](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Afiducial-limits-sample-900) — Probability and Statistics, chapter 6
- [Sampling distribution: population 4,8,12,16,20](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Apopulation-4-8-12-16-20) — Probability and Statistics, chapter 4

## Related in other subjects

- [Define moisture content, superheated vapor, etc.](https://www.bctengineer.com/question.md?key=semester_2%2Ffundamental_of_thermodynamics_and_heat_transfer%3Amoisture-superheated-definitions) — Fundamental of Thermodynamics & Heat Transfer, chapter 3
- [Quality, moisture content, specific volume of mixture](https://www.bctengineer.com/question.md?key=semester_2%2Ffundamental_of_thermodynamics_and_heat_transfer%3Aquality-moisture-specific-volume) — Fundamental of Thermodynamics & Heat Transfer, chapter 3
- [Hydrogen production and storage](https://www.bctengineer.com/question.md?key=semester_7%2Fenergy_environment_and_society%3Ahydrogen-production-storage) — Energy Environment and Society, chapter 3
- [Short note: Stored program control](https://www.bctengineer.com/question.md?key=semester_8%2Ftelecommunications%3Ashort-note-spc-digital-exchange) — Telecommunications, chapter 4
