11.8 Regression (Textbook Cost)

Aligned outcomes:

SLO 2

Identify appropriate graphs and summary statistics for variables and relationships between them and correctly interpret information from graphs and summary statistics.

SLO 4

Demonstrate an understanding of, and ability to use, basic ideas of statistical processes, including hypothesis tests and confidence interval estimation.

Learning Objectives

By the end of this section, you will be able to:

In this section, you will learn to:
  • collect real bivariate data by surveying textbooks and organize it in a table;
  • decide which variable is independent and which is dependent, and explain your choice;
  • calculate the line of best fit and the correlation coefficient using a calculator or computer;
  • use the regression equation to predict textbook costs and judge whether the correlation is significant;
  • evaluate whether the line fits the data well and whether any points should be treated as outliers.

These objectives restate the lab's own student learning outcomes: you will calculate and construct the line of best fit between two variables, and you will evaluate the relationship between those two variables to determine whether it is significant.

11.8.1 Stats Lab: Regression (Textbook Cost)

Class Time: ______________________

Names: ____________________________

11.8.2 Student Learning Outcome

The student will calculate and construct the line of best fit between two variables, and evaluate the relationship between them.

In this Stats Lab you will run a complete regression analysis on data you gather yourself. Instead of being handed a table of numbers, you will survey ten real textbooks, record how many pages each one has and what it costs, and then let your calculator find the line that best describes the relationship between those two variables. Along the way you will make the same decisions a working statistician makes: which variable drives which, whether the relationship is strong enough to trust, and what to do about any strange data points.

Why pages and cost?

Textbook prices feel arbitrary when you buy them at the bookstore. Regression lets you test a simple theory — that longer books cost more because they cost more to print and produce. If the line fits well, you have found a real pattern hiding inside your own shopping list.

Before you start, here is the vocabulary this lab uses. Bivariate data means each observation carries two measurements — here, a page count and a price. The independent variable is the one we think explains or predicts the other; the dependent variable is the one that responds. The line of best fit (also called the regression line) is the straight line that comes closest to all the data points at once, written as \(\hat{y} = a + bx\), where \(a\) is the y-intercept and \(b\) is the slope. The correlation coefficient \(r\) measures how tightly the points hug that line, running from \(-1\) to \(+1\).

Try It Now 11.8.1

Match each term to the phrase that best describes it.

  1. Bivariate data
  2. Independent variable
  3. Dependent variable
  4. Correlation coefficient
  1. the variable being predicted
  2. a number from \(-1\) to \(+1\) measuring linear association
  3. data where each observation carries two measurements
  4. the variable used to do the predicting
Solution

The matches are: 1 → c, 2 → d, 3 → a, 4 → b.

Bivariate data pairs two measurements per observation. The independent variable does the predicting (pages); the dependent variable gets predicted (cost). The correlation coefficient summarizes how tightly the points follow a straight line.

11.8.3 Collect the Data

Your first job is fieldwork. Survey ten textbooks — they can be your own books, library books, or titles listed online. For each book, record two numbers: the number of pages and the cost of the textbook. This kind of paired data is called bivariate data, because each subject (a textbook) gives us two measurements at once.

  1. Complete the table below as you collect each book's information.
Table 11.8.1 — Pages and cost for ten surveyed textbooks.
Number of pagesCost of textbook
  1. Which variable should be the dependent variable and which should be the independent variable? Why?
  2. Graph "pages" vs. "cost." Plot the points on the graph in Analyze the Data. Label both axes with words. Scale both axes.

A quick tip before you fill anything in: try to get some variety in your sample. Ten slim workbooks or ten massive organic chemistry texts will give you a cloud of points bunched in one corner, and a line through a narrow cluster tells you very little. A mix of short, medium, and long books spreads the points out and makes the pattern — whatever it is — much easier to see.

When you build the scatter plot, put pages on the horizontal axis and cost on the vertical axis. Label each axis in words ("Number of pages", "Cost of textbook ($)") and pick a scale that uses most of the available space — if your page counts run from 150 to 1,200, don't label the axis in steps of 10. Each textbook becomes one dot whose horizontal position is its page count and whose vertical position is its price.

Which variable wears the crown?

Ask yourself: if I knew only one of these numbers, which would I use to guess the other? You would naturally guess a book's cost from its page count — not the other way around. That instinct is exactly the independent/dependent distinction: pages go in first, cost comes out.

Try It Now 11.8.2

You survey ten textbooks and record their page counts and prices. Before doing any calculations, answer these setup questions.

a) In this study, what is the independent variable and what is the dependent variable?

b) Suppose one of your books is a 1,200-page anatomy text costing $280, while another is a 150-page poetry anthology costing $12. On a scatter plot with pages on the horizontal axis, roughly where would each point sit?

c) Your classmate suggests making cost the independent variable and predicting pages from it. Give one practical reason why that direction feels backwards for this data set.

Solution

Part a: The independent variable is the number of pages, because it is the measurement we use to predict the other. The dependent variable is the cost of the textbook, because cost is what responds to — and gets predicted from — the page count.

Part b: The anatomy text sits far to the right (1,200 pages) and high up ($280) — near the upper-right corner of the plot. The poetry anthology sits far to the left (150 pages) and low down ($12) — near the lower-left corner. Together they would stretch the cloud of points and strongly suggest an upward trend.

Part c: Predicting pages from cost works mathematically, but it reverses the natural logic of the situation. A publisher sets a price largely based on production factors like length, so length is the cause-like variable and price is the effect-like variable. Also, in practice nobody asks "given this price, how long is the book?" — shoppers ask "this book has 600 pages; what will it cost?" The prediction direction should match the question people actually ask.

Try It Now 11.8.3

Your completed table looks like this for the first four books:

Table 11.8.2 — First four rows of a sample survey.
BookNumber of pagesCost of textbook
1350\$65
2720\$140
3180\$30
4540\$95

a) If you were plotting these four points by hand, what scale would you choose for each axis so all four points fit comfortably and are easy to read?

b) Which point would sit highest on the plot, and why?

c) Based only on these four points, would you expect the slope of the regression line to be positive or negative? How can you tell without doing any calculation?

Solution

Part a: Page counts range from 180 to 720, so an axis scaled in steps of 100 from 0 to 800 works well. Costs range from $30 to $140, so steps of $20 from $0 to $160 fit comfortably. Both axes labeled in words, points plotted as (pages, cost).

Part b: Book 2 sits highest — its cost of $140 is the largest price in the table, and vertical position measures cost.

Part c: Positive. Every increase in page count comes with an increase in cost: 180 pages costs $30, 350 pages costs $65, 540 pages costs $95, 720 pages costs $140. When both variables rise together, the trend tilts upward, so the slope will be positive.

11.8.4 Analyze the Data

Now the calculator takes over. Enter your data into your calculator or computer — pages in one list, cost in another — and run a linear regression. Write the linear equation, rounding to four decimal places.

If you are using a TI-83/84 family calculator: press STAT, choose EDIT, and type the page counts into list L1 and the costs into list L2. Then press STAT, arrow over to CALC, choose LinReg(a+bx) — this book writes every regression line as \(\hat{y} = a + bx\), so use that form — and tell it to use L1 and L2. The calculator returns three numbers: \(a\), \(b\), and \(r\). In spreadsheet software, the functions SLOPE, INTERCEPT, and CORREL give you the same three values from your two columns.

  1. Calculate the following:

a. \(a =\) ____

b. \(b =\) ____

c. correlation \(=\) ____

d. \(n =\) ____

e. equation: \(y =\) ____

f. Is the correlation significant? Why or why not? (Answer in complete sentences.)

  1. Supply an answer for the following scenarios:

a. For a textbook with 400 pages, predict the cost.

b. For a textbook with 600 pages, predict the cost.

  1. Obtain the graph on your calculator or computer. Sketch the regression line.

Figure 11.8.1 — Sketch your scatter plot of cost versus pages here, then draw the regression line through the points.

Two things deserve attention as you read off your results. First, the slope \(b\) has a real-world meaning: it estimates how many extra dollars a book costs for each additional page. If \(b = 0.15\), each added page adds about fifteen cents to the predicted price. Second, the intercept \(a\) often looks odd — it claims to predict the cost of a zero-page book. Since no such book exists, don't over-interpret \(a\); it mainly anchors the line so predictions near your actual data range come out right.

To test significance, compare your \(r\) value against a critical value for \(n = 10\) data points. With ten pairs, the critical value at the 0.05 level is approximately \(0.632\): if your computed \(r\) is farther from zero than that (in either direction), the correlation is considered significant, meaning the pattern you see is unlikely to be pure chance.

Predictions from the equation are straightforward substitution. Take the given page count, plug it in for \(x\), multiply by the slope, add the intercept, and round sensibly — money to the nearest cent or dollar. But keep predictions inside the range of pages you actually surveyed. A line built from 100-to-900-page books has no evidence behind it at 2,000 pages, no matter how tidy the equation looks.

Try It Now 11.8.4

Suppose your regression analysis on the ten textbooks produced these results: \(a = -12.4703\), \(b = 0.1875\), and \(r = 0.8412\), with \(n = 10\).

a) Write the equation of the line of best fit.

b) Predict the cost of a textbook with 400 pages.

c) Predict the cost of a textbook with 600 pages.

d) Is the correlation significant at the 0.05 level for \(n = 10\)? Explain.

e) Interpret the slope \(b = 0.1875\) in plain English.

Solution

Step 1 — Build the equation. The line of best fit has the form \(\hat{y} = a + bx\). Substituting the calculated values:

$$\hat{y} = -12.4703 + 0.1875x$$

Step 2 — Predict at 400 pages. Substitute \(x = 400\):

$$\hat{y} = -12.4703 + 0.1875(400) = -12.4703 + 75 = \$62.53$$

A 400-page textbook is predicted to cost about $62.53.

Step 3 — Predict at 600 pages. Substitute \(x = 600\):

$$\hat{y} = -12.4703 + 0.1875(600) = -12.4703 + 112.50 = \$100.03$$

A 600-page textbook is predicted to cost about $100.03.

Step 4 — Test significance. For \(n = 10\), the critical value at the 0.05 level is approximately 0.632. Since \(|0.8412| = 0.8412 > 0.632\), the correlation is significant. There is sufficient evidence of a real linear relationship between page count and cost.

Step 5 — Interpret the slope. Each additional page adds about $0.19 (roughly nineteen cents) to the predicted cost of a textbook.

Try It Now 11.8.5

A different student runs the same analysis but forgets to round, and her calculator reports \(a = -12.4702876\), \(b = 0.18750413\), \(r = 0.84123377\).

a) Rewrite her results rounded to four decimal places, as the lab requires.

b) Using the rounded values, predict the cost of a 500-page textbook.

c) Her friend predicts the cost of a 2,500-page reference volume using the same equation and gets about $456. Explain why that prediction deserves extra caution.

Solution

Part a: Rounded to four decimal places: \(a = -12.4703\), \(b = 0.1875\), \(r = 0.8412\).

Part b: Substitute \(x = 500\):

$$\hat{y} = -12.4703 + 0.1875(500) = -12.4703 + 93.75 = \$81.28$$

A 500-page textbook is predicted to cost about $81.28.

Part c: A 2,500-page book lies far outside the range of pages the students actually surveyed (their sample presumably topped out around 1,000–1,200 pages). Predicting outside the observed data range is called extrapolation, and the straight-line pattern is not guaranteed to continue there. Very large reference volumes may be priced by entirely different rules — special bindings, small print runs — so the $456 figure is a mechanical calculation, not a trustworthy forecast.

11.8.5 Discussion Questions

The numbers are only half the job. A statistician also has to look at the fitted line and defend the choices made along the way. Answer each question in complete sentences, using your own data and graph as evidence.

  1. Answer each question in complete sentences.

a. Does the line seem to fit the data? Why?

b. What does the correlation imply about the relationship between the number of pages and the cost?

  1. Are there any outliers? If so, which point(s) is an outlier?
  2. Should the outlier, if it exists, be removed? Why or why not?

When judging the fit, look at your scatter plot honestly: do the points fall close to the line on both ends, or does the line miss them systematically? When hunting outliers, look for a point sitting far from the general trend — a cheap 900-page book or a $300 pamphlet would both qualify. And before removing anything, remember that an outlier is still real data. A lab manual priced oddly because of color printing is telling you something true about textbook pricing; deleting it just because it spoils a pretty line throws away information. Removal is justified only when you can identify a concrete reason the point doesn't belong in this data set, such as a recording error.

Try It Now 11.8.6

Your classmate's regression on ten textbooks gives \(r = 0.35\), and her scatter plot shows nine points clustered along a clear upward line plus one point far above the rest: a 200-page art book costing $310.

a) Does her line seem to fit the data well? What evidence supports your answer?

b) Is the art book an outlier? How can you tell?

c) She wants to delete the art book to raise her correlation. Give one reason she should not, and one condition under which removal would be defensible.

Solution

Part a: No, the fit is weak. A correlation of \(r = 0.35\) is well below the 0.632 critical value for \(n = 10\), so the correlation is not significant, and nine clustered points plus one stray point means the line is being dragged by a single observation rather than describing a genuine trend.

Part b: Yes. An outlier is a point that sits far from the pattern formed by the rest of the data. Nine points follow an upward line; the 200-page, $310 book sits dramatically above where that trend predicts it (a 200-page book should cost somewhere near $20–$40 based on the other points).

Part c: She should not delete it simply because it lowers \(r\) — the book is real data, and its high price may reflect expensive art reproduction, which is honest information about textbook pricing. Removal becomes defensible only if there is a concrete error: for example, she discovers the $310 figure was a typo for $31.00, or the "textbook" was actually a shrink-wrapped bundle including supplies. Fixing a verified data-entry mistake is legitimate; discarding inconvenient-but-correct data is not.

Try It Now 11.8.7

After removing the art book, your classmate reruns the regression on the remaining nine points and gets \(a = 5.2100\), \(b = 0.1620\), \(r = 0.9200\), with \(n = 9\).

a) Write her new regression equation.

b) Use it to predict the cost of a 300-page textbook.

c) Compare the new \(r = 0.92\) against the critical value for nine data points (approximately 0.666 at the 0.05 level). Is the correlation now significant?

d) What changed between her first analysis and this one, and what does that tell you about the influence a single outlier can have?

Solution

Part a: \(\hat{y} = 5.2100 + 0.1620x\)

Part b: Substitute \(x = 300\):

$$\hat{y} = 5.2100 + 0.1620(300) = 5.2100 + 48.60 = \$53.81$$

A 300-page textbook is predicted to cost about $53.81.

Part c: Since \(|0.92| = 0.92 > 0.666\), the correlation is significant at the 0.05 level for \(n = 9\). There is strong evidence of a real linear relationship once the stray point is gone.

Part d: Removing one extreme point moved the correlation from a non-significant 0.35 to a strongly significant 0.92, and it changed both the intercept and the slope. A single outlier can exert enormous leverage on a regression line — which is exactly why the Discussion Questions make you examine outliers before trusting any fitted line.

Problem Set 11.8

Problem 1. Define bivariate data and give an example other than the one in this lab.

Solution

Step 1 — Define the term: Bivariate data is paired data in which each observation carries two measurements taken from the same subject, so every data point is an ordered pair \((x, y)\).

Step 2 — Give an example: For example, recording each student's height and shoe size: each person contributes two numbers at once. (Other examples: a car's age and its mileage; a house's square footage and its sale price.)

Answer: Bivariate data consists of paired observations with two measurements per subject; an example is recording each student's height together with their shoe size.

Problem 2. In a study predicting textbook cost from page count, name the independent and the dependent variable and say how you decided.

Solution

Step 1 — Identify the roles: The independent variable is the number of pages; the dependent variable is the cost of the textbook.

Step 2 — Justify the choice: We decided by asking which variable we would use to predict the other. A book's length helps determine what it costs to produce, so pages are the cause-like variable used to do the predicting, while cost responds — nobody buys a book based on price and then wonders how many pages it has.

Answer: Independent variable: number of pages. Dependent variable: cost of the textbook, because cost is predicted from page count, not the other way around.

Problem 3. A regression gives \(a = -8.2000\) and \(b = 0.2100\). Write the equation of the line of best fit.

Solution

Step 1 — Recall the form: The line of best fit is written \(\hat{y} = a + bx\), where \(a\) is the y-intercept and \(b\) is the slope.

Step 2 — Substitute the values: With \(a = -8.2000\) and \(b = 0.2100\):

$$\hat{y} = -8.2000 + 0.2100x$$

Answer: \(\hat{y} = -8.2000 + 0.2100x\)

Problem 4. Using the equation from 11.8.3, predict the cost of a 450-page textbook.

Solution

Step 1 — Set up the substitution: Use the equation from 11.8.3 with \(x = 450\) pages:

$$\hat{y} = -8.2000 + 0.2100(450)$$

Step 2 — Compute: First multiply: \(0.2100 \times 450 = 94.50\). Then add the intercept:

$$\hat{y} = -8.2000 + 94.50 = 86.30$$

Answer: The predicted cost of a 450-page textbook is about $86.30.

Problem 5. A survey of 10 textbooks gives \(r = 0.58\). The critical value at the 0.05 level for \(n = 10\) is 0.632. Is the correlation significant? State the decision.

Solution

Step 1 — Compare \(r\) to the critical value: The computed correlation is \(r = 0.58\), and the critical value for \(n = 10\) at the 0.05 level is 0.632.

Step 2 — Apply the decision rule: The correlation is significant only if \(|r|\) exceeds the critical value. Here \(|0.58| = 0.58 < 0.632\), so the computed correlation does not reach the threshold.

Answer: The correlation is not significant. There is insufficient evidence of a real linear relationship between pages and cost in this sample.

Problem 6. Explain why the intercept of a pages-versus-cost regression is usually not worth interpreting.

Solution

Step 1 — Consider what the intercept means: The intercept \(a\) predicts the value of \(y\) when \(x = 0\) — here, the cost of a textbook with zero pages.

Step 2 — Explain why that's meaningless: No book has zero pages, so the intercept describes a book that cannot exist. It lies far outside the range of the surveyed data, where the line has no supporting evidence. Its only real job is to anchor the line so predictions within the observed page range come out right.

Answer: The intercept estimates the cost of a zero-page book, which doesn't exist and falls outside the data range, so it has no practical interpretation — it merely positions the line.

Problem 7. A line built from books of 100 to 900 pages is used to predict the cost of a 3,000-page reference set. Name what this is called and why it is not justified.

Solution

Step 1 — Name the practice: Using the regression equation outside the range of the \(x\)-values used to build it is called extrapolation.

Step 2 — Explain why it isn't justified: The line was built from books of 100 to 900 pages, so the linear pattern has only been verified on that interval. A 3,000-page reference set lies far beyond it, and there is no guarantee the straight-line trend continues there — pricing rules may change for very large volumes (special bindings, small print runs), so the prediction could be badly wrong.

Answer: This is extrapolation; it is not justified because 3,000 pages lies far outside the 100–900 page range of the data, and the linear pattern need not hold beyond the observed data.

Problem 8. A student deletes an outlier because it lowers her correlation. State what is wrong with that, and one condition under which removal would be defensible.

Solution

Step 1 — State what's wrong: Deleting an outlier simply because it lowers her correlation throws away real data to make the result look better. An outlier is still a genuine observation, and its unusual value may carry honest information (for example, an art book costs more because of expensive color reproduction). Removing inconvenient-but-correct points distorts the analysis rather than improving it.

Step 2 — Give a defensible condition: Removal would be justified only if there is concrete evidence the point does not belong in the data set — for instance, a verified recording or data-entry error (the $310 figure was actually meant to be $31.00).

Answer: Deleting an outlier just because it lowers \(r\) discards legitimate data to improve appearances. Removal is defensible only when a verifiable error shows the point doesn't belong (e.g., a confirmed typo).

Problem 9. Removing one point changes \(r\) from 0.35 to 0.92. Explain what this shows about the influence of a single observation.

Solution

Step 1 — Observe the change: Moving one point changed the correlation from \(r = 0.35\) (not significant) to \(r = 0.92\) (strongly significant) — a swing large enough to reverse the entire conclusion of the study.

Step 2 — Draw the lesson: A single extreme observation can exert enormous leverage on a regression: it can drag both the slope and the intercept away from the trend followed by the rest of the data and can mask (or create) an apparent relationship. That is why outliers must be examined before trusting any fitted line.

Answer: It shows that one observation can dominate a regression — a single outlier was powerful enough to hide a strong linear relationship, changing \(r\) from non-significant to highly significant.

Problem 10. Explain why a sample of ten books that are all roughly the same length makes a weak basis for a regression, even if the arithmetic works.

Solution

Step 1 — Identify the problem with the sample: If all ten books are roughly the same length, all the points cluster in a narrow band of \(x\)-values.

Step 2 — Explain why that weakens the regression: A regression line needs spread in the independent variable to pin down the slope reliably. With points bunched together, tiny measurement errors or one odd price can tilt the line dramatically, the estimate of \(b\) becomes unstable, and the line tells you almost nothing about how cost changes across the full range of book lengths. The arithmetic still runs, but the conclusion rests on almost no information about the overall pattern.

Answer: Books of nearly identical length give no spread in the independent variable, so the slope estimate is unstable and the line reveals little about the true pages–cost relationship, even though the calculations can be performed.

Key Terms

bivariate data — paired data in which each observation carries two measurements, such as a textbook's page count and its cost.

independent variable — the variable used to predict the other; plotted on the horizontal axis. Here, the number of pages.

dependent variable — the variable that responds to, and is predicted from, the independent variable. Here, the cost of the textbook.

line of best fit (regression line) — the straight line \(\hat{y} = a + bx\) that comes closest to all the data points, where \(a\) is the intercept and \(b\) is the slope.

correlation coefficient (\(r\)) — a number between \(-1\) and \(+1\) measuring how tightly the data points follow a straight-line pattern.

outlier — a data point that lies far from the pattern formed by the rest of the observations.