generate_data
draws random data for a 2SLS model given the parameters.
generate_data(parameters, n)
generate_data
returns a data frame with n
rows
(observations) and the following variables of the 2SLS model: dependent
variable y, exogenous regressors x1, endogenous regressors x2, structural
error u, outside instruments z2, first stage projection errors r1 (identical
to zero) and r2.
A list with 2SLS model parameters as created by generate_param.
Sample size to be drawn.