- Simple Linear Regression is a method to understand the relationship between two variables.
- The variable we want to infer or predict is called the dependent variable.
- The variable we use for prediction is called the independent variable.
2026-09-17
The model is expressed with a linear equation:
\[y = \beta_0 + \beta_1 x + \varepsilon\]
set.seed(67)
myX <- rnorm(100, mean = 30, sd = 5)
myY <- rnorm(100)
myZ <- rnorm(100, mean = 15, sd = 2)
plot_ly(x = ~myX, y = ~myY, z = ~myZ,
type = "scatter3d", mode = "markers",
marker = list(color = "#8C1D40", size = 4),
width = 700, height = 400) %>%
hide_colorbar() %>%
layout(scene = list(
xaxis = list(title = "X"),
yaxis = list(title = "Y"),
zaxis = list(title = "Z")
))