Skip to content

Instantly share code, notes, and snippets.

View mikedecr's full-sized avatar

Mike DeCrescenzo mikedecr

View GitHub Profile
# Creates a 3D plot to demonstrate how a combination of OLS parameters minimizes residual sum of squares
# set values for X
x <- seq(-50, 50, 1)
# Y as a function of X with random error
y <- NA
for (i in 1:length(x)) {
y[i] <- 2*x[i] + rnorm(1, 0, 5)
}