Linear regression for two variables is based on a linear equation with one independent variable. The equation has the form:
\[y=a+\mathrm{bx}\]
where \(a\) and \(b\) are constant numbers.
The variable \(x\) is the independent variable, and \(y\) is the dependent variable. Another way to think about this equation is a statement of cause and effect. The \(X\) variable is the cause and the \(Y\) variable is the hypothesized effect. Typically, you choose a value to substitute for the independent variable and then solve for the dependent variable.
The following examples are linear equations.
\[\begin{array}{c}
y=3+2 \mathrm{x} \\
y=-0.01+1.2 \mathrm{x}
\end{array}\]
Graph the equation y = –1 + 2x.
- Answer
-
Figure \(\PageIndex{1}\)
A mobile physical therapist provides in-home recovery sessions. The rate for services is $32 per hour of treatment, plus a $31.50 one-time travel and equipment setup fee. The total cost to the patient depends on the number of hours the therapist spends on-site.
Problem
Find the equation that expresses the total cost in terms of the number of hours required to complete the therapy session.
- Answer
-
Let x= the number of hours the therapist is on-site.
Let y= the total cost to the patient.
The $31.50 is a fixed cost (the intercept). If it takes x hours to complete the session, then (32)(x) is the variable cost for the professional time only (the slope). The total cost is:
The total cost is: y = 31.50 + 32x
Svetlana provides private personal training sessions to make extra money for college. For each session, she charges a one-time "travel and assessment" fee of $25, plus $15 per hour of training. A linear equation that expresses the total amount of money Svetlana earns for each session is: y = 25 + 15x.
Problem
What are the independent and dependent variables? What is the y-intercept and what is the slope? Interpret them using complete sentences.
- Answer
-
Independent Variable (x): The number of hours Svetlana trains the client during the session.
Dependent Variable (y): The total amount, in dollars, Svetlana earns for each session.
y-intercept: The y-intercept is 25 (a=25). This represents the fixed cost of the session; even if she trains for zero hours (x=0), she still charges the one-time $25 fee to cover her assessment and travel.
Slope: The slope is 15 (b=15). This represents the rate of change in earnings; for every additional hour she trains, Svetlana earns an additional $15.


