View source: R/simulation_dgp.R
simulation_dgp | R Documentation |
Simulates observations from the data-generating process considered in Lee and Ng (2022)
simulation_dgp(n, d, hetero = FALSE)
n |
sample size |
d |
dimension of regressors from a multivariate normal distribution |
hetero |
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 |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.