# make_plr_turrell2018: Generates data from a partially linear regression model used... In DoubleML: Double Machine Learning in R

## Description

Generates data from a partially linear regression model used in a blog article by Turrell (2018). The data generating process is defined as

d_i = m_0(x_i' b) + v_i,

y_i = θ d_i + g_0(x_i' b) + u_i,

with v_i \sim \mathcal{N}(0,1), u_i \sim \mathcal{N}(0,1), and covariates x_i \sim \mathcal{N}(0, Σ), where Σ is a random symmetric, positive-definite matrix generated with clusterGeneration::genPositiveDefMat(). b is a vector with entries b_j=\frac{1}{j} and the nuisance functions are given by

m_0(x_i) = \frac{1}{2 π} \frac{\sinh(γ)}{\cosh(γ) - \cos(x_i-ν)},

g_0(x_i) = \sin(x_i)^2.

## Usage

 1 2 3 4 5 6 7 8 make_plr_turrell2018( n_obs = 100, dim_x = 20, theta = 0.5, return_type = "DoubleMLData", nu = 0, gamma = 1 ) 

## Arguments

 n_obs (integer(1)) The number of observations to simulate. dim_x (integer(1)) The number of covariates. theta (numeric(1)) The value of the causal parameter. return_type (character(1)) If "DoubleMLData", returns a DoubleMLData object. If "data.frame" returns a data.frame(). If "data.table" returns a data.table(). If "matrix" a named list() with entries X, y and d is returned. Every entry in the list is a matrix() object. Default is "DoubleMLData". nu (numeric(1)) The value of the parameter ν. Default is 0. gamma (numeric(1)) The value of the parameter γ. Default is 1.

## Value

A data object according to the choice of return_type.

## References

Turrell, A. (2018), Econometrics in Python part I - Double machine learning, Markov Wanderer: A blog on economics, science, coding and data. http://aeturrell.com/2018/02/10/econometrics-in-python-partI-ML/.

DoubleML documentation built on Oct. 26, 2021, 5:06 p.m.