2024-06-04
The simple linear regression model can be expressed as:
\[ Y = \beta_0 + \beta_1X + \epsilon \]
Suppose we want to predict the sales of a product based on advertising expenditure. We collect data on advertising spending (\(X\)) and corresponding sales (\(Y\)) for different products.
Let’s perform simple linear regression to model this relationship.
In simple linear regression, the null and alternative hypotheses are related to the slope (\(\beta_1\)):
## `geom_smooth()` using formula = 'y ~ x'
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels ## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels