Category Archives: Econometrics

>R code for OLS

>Just to show the mathematics involved in computing the OLS coefficients on a simulated data set (which is a good approach to really learning econometrics): set.seed(1234)n <- 1000×1 <- rnorm(n)x2 <- runif(n)X <- cbind(1, x1, x2)k <- ncol(X)beta <- c(2, … Continue reading

Posted in Econometrics, Numerical methods, Programming, R | Leave a comment