13Simple Linear Regression
13.1 Introduction
There is an immense amount of situations where one variable depends on another. For a given amount of money, the new balance in a bank account after a year is a function of the bank's interest rate. Similarly, the revenue of selling shirts at $12 a shirt is a function of the amount of shirts sold. Suppose the cost of a service is a linear function of usage of the service. For example, the monthly electricity bill may be
where
is the amount to be paid,
is the kilowatt‐hour for the month. 0.15 ¢ represents the cost per kilowatt‐hour. The equation tells us there is a basic monthly charge of $5. Hence, if a client is on vacation (and has unplugged everything) and consumed a total of 0 kWh, they must still pay $5 to the power company. If a client uses 100 kWh, their bill for the month should be
. Figure 13.1 presents the association between power bill amount and kilowatt‐hour usage.
This example shows us that it is very convenient to express a variable as a function of another. If we know the kilowatt‐hours, cost per kilowatt‐hour and basic ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access