simulation_dgp: Simulating observations from the data-generating process...

View source: R/simulation_dgp.R

simulation_dgpR Documentation

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

Description

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

Usage

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)

Value

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

References

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

Examples

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


sketching documentation built on Sept. 7, 2022, 5:08 p.m.