5.4.1.2 Linear Regression
Data Analytics
Linear regression is a common statistical model used to understand the relationship between two variables. It is often used to predict one variable based on another. Let's go through a practical example to explain how it works.
Example: Imagine you run a small fruit stall in your town, and you want to predict how much money you will make each day based on the number of customers who visit your stall. The number of customers is the independent variable (the cause), and the money you earn is the dependent variable (the effect). We will use linear regression to understand this relationship and help you predict future earnings.
- Step 1: Collecting Data
To build a linear regression model, we need data. Let's assume you've recorded the number of customers and your daily earnings for the last 5 days:
| Number of Customers | Daily Earnings (in Rupees) |
|---|---|
10 | 500 |
15 | 700 |
20 |