plot_ML: Plot the fitted Debiased ML treatment effects.

Description Usage Arguments Details Value Examples

View source: R/plot_ML.R

Description

A function to plot the estimated treatment effects.

Usage

1
plot_ML(x, coloured.same = TRUE, palette = NULL, ...)

Arguments

x

The estimated ML_Treatment_effects object to plot

coloured.same

Whether to use the same colour for all plots, defaults to TRUE.

palette

An optional custom colour/vector of palette colour codes to be used for plotting.

...

Additional arguments (currently ignored).

Details

The plot samples a random colour from a predefined colourblind palette by default. You may use a custom colour/colour palette for plotting by supplying the palette argument. If you supply a palette, the colour will be used in the order in which they are specified. Palette lengths longer than the number of plots will be ignored.

Value

Nothing - as a side effect produces a plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  n = 2000; p = 10
  X = matrix(rnorm(n*p), n, p)
  W = rbinom(n, 1, 0.4 + 0.2 * (X[,1] > 0))
  Y = pmax(X[,1], 0) * W + X[,2] + pmin(X[,3], 0) + rnorm(n)

    ols_example <- double_ML(X, Y, W, method = c("ols"),
                             show.progress = FALSE,
                             k.fld = 2,
                             simulations = 10)

   plot_ML(ols_example)

postDoubleR documentation built on Oct. 7, 2019, 5:05 p.m.