Skip to contents

These functions provides pre-specified transformations to control flexibly for the selection probabilities in the regression.
These correspond to \(\kappa_d(p)\) and corresponding \(k_d(u)\) in Bruneel-Zupanc (2024).
Special functions are used for homogenous treatment effect specifications because the code is different. July 2024: for now, only polynomial transformations are encoded.

Usage

Kappa_fun(p, pol_degree = 5)

kdu_transform_fun(u, d, pol_degree = 5)

Kappa_homogenous_fun(p, pol_degree = 5)

ku_transform_homogenous_fun(u, pol_degree = 5)

Arguments

p

Vector of propensity scores to transform into a flexible function.

pol_degree

Degree of the polynomial transformation.

d

Which potential outcome to consider (only needed for \(k_d(u)\) with heterogenous treatment effects).

Details

See Andresen (2018) or Bruneel-Zupanc (2024) for computation details linking \(\kappa_d(p)\) and the corresponding corresponding \(k_d(u)\).
\(\kappa_1(p) = E(U_1 | U_D \leq p) \) and \(\kappa_0(p) = E(U_0 | U_D>p) \) while \(k_d(u) = E(U_d | U_D=u)\).

In the case of homogenous treatment effects: \(k_0(u) = k_1(u)\). This provides some restriction on \(\kappa\), hence the special functions.

Examples

v = seq(0.1, 0.9, by=0.1)
# Transformations for general Heterogenous TE functions:
Kappa_fun(p=v, pol_degree=6)
#>         1    2     3      4       5        6
#>  [1,] 0.1 0.01 0.001 0.0001 0.00001 0.000001
#>  [2,] 0.2 0.04 0.008 0.0016 0.00032 0.000064
#>  [3,] 0.3 0.09 0.027 0.0081 0.00243 0.000729
#>  [4,] 0.4 0.16 0.064 0.0256 0.01024 0.004096
#>  [5,] 0.5 0.25 0.125 0.0625 0.03125 0.015625
#>  [6,] 0.6 0.36 0.216 0.1296 0.07776 0.046656
#>  [7,] 0.7 0.49 0.343 0.2401 0.16807 0.117649
#>  [8,] 0.8 0.64 0.512 0.4096 0.32768 0.262144
#>  [9,] 0.9 0.81 0.729 0.6561 0.59049 0.531441
#> attr(,"degree")
#> [1] 1 2 3 4 5 6
#> attr(,"class")
#> [1] "poly"   "matrix"
k1u = kdu_transform_fun(v, d=1, pol_degree=6)

# Transformations for Homogenous TE functions:
Kappa_homogenous_fun(p=v, pol_degree=6)
#>       const   1    2     3      4       5        6
#>  [1,]     1 0.1 0.01 0.001 0.0001 0.00001 0.000001
#>  [2,]     1 0.2 0.04 0.008 0.0016 0.00032 0.000064
#>  [3,]     1 0.3 0.09 0.027 0.0081 0.00243 0.000729
#>  [4,]     1 0.4 0.16 0.064 0.0256 0.01024 0.004096
#>  [5,]     1 0.5 0.25 0.125 0.0625 0.03125 0.015625
#>  [6,]     1 0.6 0.36 0.216 0.1296 0.07776 0.046656
#>  [7,]     1 0.7 0.49 0.343 0.2401 0.16807 0.117649
#>  [8,]     1 0.8 0.64 0.512 0.4096 0.32768 0.262144
#>  [9,]     1 0.9 0.81 0.729 0.6561 0.59049 0.531441
ku = ku_transform_homogenous_fun(v, pol_degree=6) # no d anymore, same for both d here;