simulation_dgp function

Simulating observations from the data-generating process considered in Lee and Ng (2022)

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)

Arguments

  • 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)

Returns

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

Examples

data <- simulation_dgp(100, 5, hetero = TRUE) y <- data$Y x <- data$X model <- lm(y ~ x)

References

Lee, S. and Ng, S. (2022). "Least Squares Estimation Using Sketched Data with Heteroskedastic Errors," arXiv:2007.07781.

  • Maintainer: Sokbae Lee
  • License: GPL-3
  • Last published: 2022-09-07