Simulating observations from the data-generating process considered in Lee and Ng (2022)
Simulates observations from the data-generating process considered in Lee and Ng (2022)
simulation_dgp(n, d, hetero = FALSE)
n
: sample sized
: dimension of regressors from a multivariate normal distributionhetero
: TRUE if the conditional variance of the error term is heteroskedastic and FALSE if it is homoskedastic (default: FALSE)An S3 object has the following elements. - Y: n observations of outcomes
X: n times d matrix of regressors
beta: d dimensional vector of coefficients
data <- simulation_dgp(100, 5, hetero = TRUE) y <- data$Y x <- data$X model <- lm(y ~ x)
Lee, S. and Ng, S. (2022). "Least Squares Estimation Using Sketched Data with Heteroskedastic Errors," arXiv:2007.07781.