Perform linear, polynomial, and multiple regression with visualization
Linear regression is a statistical method that models the relationship between a dependent variable (Y) and one or more independent variables (X).
Regression Equation:
Where:
| Term | Description | Formula |
|---|---|---|
| Slope (b) | Rate of change in Y per unit change in X |
|
| Intercept (a) | Value of Y when X=0 |
|
| R-squared | Proportion of variance explained by model |
|
| Standard Error | Average distance of data points from regression line |
|
| Residual | Difference between observed and predicted value |
|
Assumptions of Linear Regression:
Regression analysis is widely used across various fields:
Real-World Example: A retailer might use regression analysis to predict sales based on advertising spend, finding that for every $1,000 spent on advertising, sales increase by $5,000.
Common questions about regression analysis:
Correlation: Measures the strength and direction of the relationship between two variables.
Regression: Models the relationship to predict values of the dependent variable based on the independent variable.
Key differences:
R-squared (coefficient of determination) measures the proportion of variance in the dependent variable that is predictable from the independent variable.
Example: An R-squared of 0.85 means 85% of the variation in Y is explained by X.
The p-value in regression analysis helps determine the significance of the relationship:
Example: A p-value of 0.015 for the slope means there's only a 1.5% chance that the observed relationship occurred by random chance.
The required sample size depends on several factors:
General guidelines: