Linear regression for two variables is based on a linear equation with one independent variable. The equation has the form:
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.
The graph of a linear equation of the form \(Y = a + bX\) is a straight line. Any line that is not vertical can be described by this equation
Graph the equation \(Y = –1 + 2X\).
Is the following an example of a linear equation? Why or why not?
Aaron's Word Processing Service (AWPS) does word processing. The rate for services is $32 per hour plus a $31.50 one-time charge. The total cost to a customer depends on the number of hours it takes to complete the job.
Find the equation that expresses the total cost in terms of the number of hours required to complete the job.
Let \(X\) = the number of hours it takes to get the job done.
Let \(Y\) = the total cost to the customer.
The $31.50 is a fixed cost. If it takes \(X\) hours to complete the job, then (32)(\(X\)) is the cost of the word processing only. The total cost is: \(Y = 31.50 + 32X\)
Slope and Y-Intercept of a Linear Equation
For the linear equation \(Y = a + bX\), \(b\) = slope and \(a = Y\)-intercept. From algebra recall that the slope is a number that describes the steepness of a line, and the \(Y\)-intercept is the \(Y\) coordinate of the point \((0, a)\) where the line crosses the y-axis. From calculus the slope is the first derivative of the function. For a linear function, the slope is \(dY / dX = b\) where we can read the mathematical expression as "the change in \(Y (dY)\) that results from a unit change in \(X (dX)\) equals \(b\)".
Sven tutors to make extra money for college. For each tutoring session, he charges a one-time fee of $25 plus $15 per hour of tutoring. A linear equation that expresses the total amount of money Sven earns for each session he tutors is \(Y = 25 + 15X\).
What are the independent and dependent variables? What is the \(Y\)-intercept and what is the slope? Interpret them using complete sentences.
The independent variable (\(X\)) is the number of hours Sven tutors each session. The dependent variable (\(Y\)) is the amount, in dollars, Sven earns for each session.
The \(Y\)-intercept is 25 \((a = 25\)). At the start of the tutoring session, Sven charges a one-time fee of $25 (this is when \(X= 0\)). The slope is 15 \((b = 15)\). For each session, Sven earns $15 for each hour he tutors.