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