Last Update: March 22, 2022
My online video tutorials are hosted at YouTube channel.
For learning this concept, you can view my online video tutorial: Simple Linear Regression in R.
Video Code
1. Packages
library(AER)
library(ggplot2)
2. Data
data(HousePrices)
3. Chart
ggplot(data = HousePrices, aes(x = lotsize, y = price)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE)
4. Model
slr <- lm(formula = price ~ lotsize, data = HousePrices)
slr
Courses
My online courses are hosted at Teachable website.
For more details on this concept, you can view my Linear Regression in R Course.