Generate Data for Simulation Studies
numeric Number of observations.
character Type of IV propensity score DGP.
numeric Compliance rate.
numeric Coefficient associated with the treatment difference.
numeric Coefficients associated with x1
.
numeric Coefficients associated with x2
.
numeric Coefficients associated with x1 * x2
.
"gumbel" or "normal".
A data frame
set.seed(42)
generate_data(n_obs = 6, ps_type = "la")
#> x1 x2 eta p z c a ey y
#> 1 0.9148060 0.7365883 0.6198471 0.6501838 0 1 0 -0.05820880 -0.9330284
#> 2 0.9370754 0.1346666 2.4701510 0.9220226 1 1 1 1.37427109 4.9348077
#> 3 0.2861395 0.6569923 -0.3986978 0.4016252 0 0 1 1.77822261 1.5519152
#> 4 0.8304476 0.7050648 0.5457009 0.6331376 0 1 0 -0.07832154 1.0934560
#> 5 0.6417455 0.4577418 0.9102657 0.7130545 0 0 1 2.00031746 2.7443554
#> 6 0.5190959 0.7191123 -0.1191449 0.4702490 0 0 1 1.82931858 2.3039565