Linear Regression Solved Numerical Example with One Independent Variable
In this tutorial, we will understand how to use a regression equation to predict the glucose level given the age. We will consider the following is the data set for understanding the concept of Linear Regression Numerical Example with One Independent Variable.
SUBJECT | AGE X | GLUCOSE LEVEL Y |
1 | 43 | 99 |
2 | 21 | 65 |
3 | 25 | 79 |
4 | 42 | 75 |
5 | 57 | 87 |
6 | 59 | 81 |
7 | 55 | ? |
Solution:
Video Tutorial Linear Regression Solved Example with One Independent Variable
Regression analysis is used to:
- Predict the value of a dependent variable based on the value of at least one independent variable.
- Explain the impact of changes in an independent variable on the dependent variable.
The dependent variable is the variable we wish to explain and
Independent variable is the variable used to explain the dependent variable
The key steps for regression are simple:
- List all the variables available for making the model.
- Establish a dependent variable of interest.
- Examine visual (if possible) relationships between variables of interest.
- Find a way to predict the dependent variables using the other variables.
The regression model is described as a linear equation that follows.
y is the dependent variable, that is, the variable being predicted.
x is the independent variable or the predictor variable.
There could be many predictor variables (such as x1, x2, . . .) in a regression equation.
However, there can be only one dependent variable (y) in the regression equation.
Here we need to find the value of bo, b1 using the following equation.
Step 1: Make a chart of your data, filling in the columns in the same way as you would fill in the chart if you were finding the Pearson’s Correlation Coefficient
SUBJECT | AGE X | GLUCOSE LEVEL Y | XY | X2 | Y2 |
1 | 43 | 99 | 4257 | 1849 | 9801 |
2 | 21 | 65 | 1365 | 441 | 4225 |
3 | 25 | 79 | 1975 | 625 | 6241 |
4 | 42 | 75 | 3150 | 1764 | 5625 |
5 | 57 | 87 | 4959 | 3249 | 7569 |
6 | 59 | 81 | 4779 | 3481 | 6561 |
Σ | 247 | 486 | 20485 | 11409 | 40022 |
Step 2: Use the following equations to find b0 and b1.
Find b0:
Find b1:
Step 3: Insert the values into the equation.
y’ =bo +b1 * x
y’ = 65.14 + (0.385225 * x)
Step 4: Prediction – the value of y for the given value of x = 55
y’ = 65.14 +(0.385225 ∗55)
y’ =86.327
Summary:
In this tutorial, we understood, how to use a Linear regression with One Independent Variable to predict the glucose level given the age – a Solved Example. If you like the tutorial share it with your friends. Like the Facebook page for regular updates and YouTube channel for video tutorials.