Linear Modeling and Applications
Medication dosages, IV drip rates, vital monitoring
Refrigerant charging, airflow, system sizing
Discounts, tax, tips, profit margins
A linear model uses a linear equation to describe the relationship between two real-world quantities. When data follows an approximately straight-line pattern, you can write an equation, interpret what the slope and y-intercept mean in context, and use the model to make predictions. This skill bridges the gap between abstract algebra and practical decision-making.
Identifying Linear Relationships
A relationship between two variables is approximately linear when:
- A constant change in one variable produces a roughly constant change in the other
- A scatter plot of the data points lies close to a straight line
- The rate of change between consecutive data points is relatively consistent
For example, if a delivery truck uses about 6 gallons of fuel for every 100 miles driven, the fuel-distance relationship is roughly linear.
Not everything is linear. Population growth, compound interest, and the area of a square as its side length changes are not linear β they involve exponential or polynomial patterns. Linear models work best over limited ranges where the rate of change stays approximately constant.
Building a Linear Model from Two Data Points
The simplest method: pick two representative data points, calculate the slope, and write the equation.
Example 1: Fuel consumption
A trucking company records that a truck used 30 gallons of diesel to travel 180 miles and 55 gallons to travel 330 miles. Write a linear model relating miles driven () to gallons used ().
Step 1 β Identify two data points: and
Step 2 β Calculate the slope:
Step 3 β Use point-slope form with :
The model:
This means the truck uses about of a gallon per mile, or equivalently, gets about 6 miles per gallon. The y-intercept is , which makes sense β zero miles driven means zero fuel used.
Example 2: Temperature and altitude
A hiker records the temperature at two elevations: 68 degrees F at 2,000 feet and 53 degrees F at 5,000 feet. Write a linear model.
Data points: and
Slope:
Equation using :
Interpretation: Temperature drops about 0.005 degrees F per foot of elevation gain (or 5 degrees per 1,000 feet). At sea level (), the model predicts 78 degrees F.
Interpreting Slope and Y-Intercept in Context
The power of linear modeling lies in interpreting the numbers:
- Slope = the rate of change β how fast changes per unit change in
- Y-intercept = the starting value β the value of when
Always state these interpretations using the units and context of the problem, not just as abstract numbers.
Example 3: Interpreting a business model
A coffee shopβs monthly profit is modeled by , where is the number of drinks sold and is profit in dollars.
- Slope = 3.50: Each drink sold adds $3.50 to the monthly profit
- Y-intercept = : If the shop sells zero drinks, it loses $2,800 (these are fixed costs: rent, utilities, salaries)
- Break-even: Set : drinks. The shop must sell 800 drinks per month to break even.
Example 4: Interpreting a medical model
A nurse uses the model to estimate the dosage (, in mL) of a medication based on a patientβs weight (, in kg) for patients weighing between 40 and 120 kg.
- Slope = 0.05: For every additional kilogram of body weight, the dosage increases by 0.05 mL
- Y-intercept = 2: The base dosage is 2 mL (the minimum amount given regardless of weight)
- For a 70 kg patient: mL
Making Predictions
Once you have a linear model, you can predict for any value of by substituting into the equation.
Interpolation = predicting within the range of your data (more reliable)
Extrapolation = predicting beyond the range of your data (less reliable β use with caution)
Example 5: Prediction and interpolation
Using the temperature-altitude model from Example 2, predict the temperature at 3,500 feet.
Prediction: About 60.5 degrees F at 3,500 feet. This is interpolation (3,500 is between 2,000 and 5,000), so the prediction is reasonably reliable.
Example 6: Extrapolation (use with caution)
Using the same model, predict the temperature at 20,000 feet.
The model predicts degrees F. While this might be roughly in the right ballpark, the actual relationship between temperature and altitude is not perfectly linear over such a large range β atmospheric conditions, wind patterns, and temperature inversions can cause significant deviations. This is a warning about extrapolation: the further you go beyond your data, the less reliable the prediction.
Building Models from Larger Data Sets
When you have more than two data points, you need to decide which points best represent the overall trend. Two common approaches:
Eyeball method: Plot the points, draw a line that appears to fit the data well, and pick two points on that line (not necessarily data points) to write the equation.
Endpoint method: Use the first and last data points if the overall trend is clear.
Example 7: Modeling from a data table
An HVAC technician records monthly heating costs for a building:
| Month (Oct = 1) | Avg Outdoor Temp (F) | Heating Cost |
|---|---|---|
| 1 | 55 | $180 |
| 2 | 42 | $260 |
| 3 | 30 | $340 |
| 4 | 25 | $370 |
| 5 | 35 | $310 |
Using the first and third data points, and :
Slope:
Equation:
Interpretation: For each 1-degree drop in outdoor temperature, the heating cost increases by about $6.40. When the outdoor temperature is 0 degrees F, the model predicts a heating cost of $532.
Check against another data point: At : . The actual cost was $260, so the model is a close fit.
Real-World Application: Nursing β IV Drip Rate
A nurse is monitoring an IV fluid bag. She records the following:
- At 10:00 AM (time 0), the bag contains 500 mL
- At 10:45 AM (time 45 minutes), the bag contains 365 mL
Step 1 β Write the model:
Data points: and
where is time in minutes and is the volume remaining in mL.
Step 2 β Interpret:
- Slope = : The bag is draining at a rate of 3 mL per minute
- Y-intercept = 500: The bag started with 500 mL
Step 3 β Predict when the bag will be empty:
Set : minutes
The bag will be empty about 167 minutes after 10:00 AM, which is approximately 12:47 PM. The nurse uses this to schedule the next bag change or adjust the drip rate.
Step 4 β Check at an intermediate time:
At 11:00 AM (): mL remaining. The nurse can verify this against the actual bag reading to confirm the drip rate is steady.
Limitations of Linear Models
Linear models are powerful but have boundaries:
-
Valid range: A linear model is trustworthy only within (or close to) the range of the original data. Extreme extrapolation often produces nonsensical results.
-
Constant rate assumption: Linear models assume the rate of change stays the same. If the rate speeds up or slows down (e.g., population growth, compound interest), a linear model will be inaccurate.
-
Negative predictions: Some models may predict negative values for quantities that cannot be negative (you cannot have negative fuel or negative patients). Always check whether the prediction makes physical sense.
-
Correlation is not causation: Just because two variables follow a linear pattern does not mean one causes the other. Ice cream sales and drowning incidents both increase in summer β but ice cream does not cause drowning.
-
Rounding and measurement error: Real-world data is never perfectly linear. A linear model is an approximation, and small errors in measurement compound when you extrapolate.
Common Mistakes to Avoid
-
Interpreting slope without units. Saying βthe slope is 3.5β is incomplete. Say βthe slope is 3.5 dollars per unitβ or β3.5 mL per kgβ β always include the context.
-
Ignoring the domain. A model for an IV bag only makes sense for . Outside that range, the model predicts negative fluid, which is meaningless.
-
Assuming linearity without checking. Before building a linear model, verify that the data is approximately linear. If the scatter plot curves, a linear model will be a poor fit.
-
Confusing the variables. Be clear about which variable is (independent/input) and which is (dependent/output). Switching them changes the slope and the interpretation.
-
Over-trusting extrapolation. Predictions far outside your data range are educated guesses at best. Always note the range of the original data when reporting predictions.
Practice Problems
Test your understanding with these problems. Click to reveal each answer.
Problem 1: A plumber charges $85 for a house call plus $70 per hour of labor. Write a linear model for the total cost in terms of hours worked . What is the cost of a 3-hour job?
For a 3-hour job:
Answer: . A 3-hour job costs $295. The slope (70) is the hourly rate and the y-intercept (85) is the flat service fee.
Problem 2: A candle is 12 inches tall when lit. After 2 hours it is 9 inches tall. Write a linear model and predict when the candle will burn out.
Points: and
Slope:
Model:
Burn out ():
Answer: . The candle burns at 1.5 inches per hour and will burn out after 8 hours.
Problem 3: A retail store tracks sales: 200 units sold at a price of $25, and 350 units sold when the price was lowered to $15. Write a linear model for units sold () as a function of price (). Interpret the slope.
Points: and
Slope:
Using :
Answer: . The slope of means that for every $1 increase in price, 15 fewer units are sold (and vice versa).
Problem 4: An HVAC system cools a room from 88 degrees F to 72 degrees F in 20 minutes. Assuming a constant cooling rate, write a model and predict the temperature after 30 minutes. Is this prediction reliable?
Points: and
Slope:
Model:
At :
Prediction: 64 degrees F. This is extrapolation beyond the original data. In practice, as the room temperature approaches the thermostat setting, the cooling rate slows down β so the actual temperature would likely be higher than 64 degrees F. The linear model is less reliable for this prediction.
Answer: , predicting 64 degrees F at 30 minutes, but the prediction is likely too low because cooling rate decreases as the room approaches the target temperature.
Problem 5: A nurse records that a patientβs blood pressure medication level was 120 mg in the bloodstream at 8:00 AM and 80 mg at 12:00 PM (4 hours later). Write a linear model. At what time will the level drop to 20 mg?
Points: and
Slope:
Model:
When :
Answer: . The medication level drops at 10 mg per hour. It will reach 20 mg at 10 hours after 8:00 AM, which is 6:00 PM. (Note: actual drug elimination often follows exponential decay, so this linear model is an approximation valid only over the observed range.)
Problem 6: The following data shows the number of customers at a restaurant by hour after opening. Is a linear model appropriate?
| Hour | Customers |
|---|---|
| 1 | 15 |
| 2 | 45 |
| 3 | 90 |
| 4 | 80 |
| 5 | 40 |
| 6 | 20 |
Look at the changes: , , , , . The rate of change is not constant β customers rise sharply, peak, then decline. This pattern is not linear; it follows a curve (likely a peak or bell shape).
Answer: A linear model is not appropriate. The data rises and then falls, indicating a non-linear pattern. A linear model would miss the peak entirely.
Key Takeaways
- A linear model uses to describe a real-world relationship with an approximately constant rate of change
- Slope is the rate of change in context β always state it with units (dollars per hour, mL per minute, degrees per foot)
- Y-intercept is the starting value β the output when the input is zero
- Interpolation (predicting within your data range) is more reliable than extrapolation (predicting beyond it)
- Always check whether a linear model is appropriate before using it β look for a constant rate of change and a roughly straight scatter plot
- State the valid domain of your model and note any limitations
Return to Algebra 1 for more topics in this section.
Next Up in Algebra
Last updated: March 29, 2026