Chapter 3 · Section 1 practice

Business Questions and Association

Work from question 1 to 10. Edit your Python box, click Run Code, review the result, then click Submit attempt. Reference answers unlock after all ten attempts are submitted. This records completion, not correctness. Each box runs independently. Progress is saved in this browser.

Submitted: 0 / 10

1. Identify the response

Warm-up. Print the Revenue Series. State its units.

Write your answer, then run it.

2. Select paired variables

Warm-up. Print only Ads and Revenue for the first three weeks.

Write your answer, then run it.

3. Count observations

Warm-up. Print the number of paired weekly records.

Write your answer, then run it.

4. Compute correlation

Build your skills. Print the Ads–Revenue correlation rounded to three decimals.

Write your answer, then run it.

5. Change currency units

Build your skills. Convert Revenue into HKD and verify that correlation is unchanged.

Write your answer, then run it.

6. Compare two relationships

Build your skills. Print correlations of Revenue with Ads and Price.

Write your answer, then run it.

7. Inspect an unusual week

Build your skills. Replace the last Revenue by 45 and print the new correlation.

Write your answer, then run it.

8. Calculate a curved example

Challenge. Create a Series of location offsets [-3, -2, -1, 0, 1, 2, 3]. Set cost = 5 + offset ** 2. Print their correlation rounded to six decimals.

Write your answer, then run it.

9. Compare a transformed predictor

Challenge. Using the same offsets and costs, compare correlation with offset against correlation with offset ** 2. Print both to three decimals.

Write your answer, then run it.

10. Support a cautious conclusion

Challenge. Print the Ads–Revenue correlation. Then explain why a near-zero correlation cannot rule out association, and why a large correlation does not prove an advertising effect.

Write your answer, then run it.

Reference answers are locked until all 10 attempts are submitted.