simulate_data {drape}R Documentation

Generate simulation data.

Description

If ex_setting = "401k" then 401k data set is used for (X,Z). Otherwise:

Z ~ N_{9}(0,\Sigma),

where \Sigma_{jj} = 1, \Sigma_{jk} = 0.5 for all j not equal to k.

X = m(Z) + s(Z)*ex,

where m and s are step functions of z_1 and z_3 respectively.

Y = f(X,Z) + N(0,1).

Usage

simulate_data(n, ex_setting, f_setting)

Arguments

n

integer number of samples. For "401k" ex_setting this is ignored and the whole data set is used.

ex_setting

string "normal", "mixture2", "mixture3", "logistic", "t4", "401k".

f_setting

string "plm", "additive", "interaction".

Value

list containing y, x, z. Additionally contains the population nuisance parameters evaluated on the data, and the sample version of the average partial effect.

Examples

simulate_data(100, "normal", "plm")

[Package drape version 0.0.2 Index]