Description Usage Arguments Details Value
This function plots the response surface or the marginal effect fitted by the ace
package around the training sample. For non-binary treatments, the method can display the interaction of the treatment with one confounder.
The package plots:
for binary treatments, a 2D plot with X[, Xcol]
on the x-axis. This plots,
if marginal = FALSE
: the treatment and control reponse surfaces.
if marginal = TRUE
: the treatment effect.
For non-binary (continuous and -for now- categorial) treatments the method can display a 2D contour or a 3D surface plot with the interaction between the treatment and a specified confounder through Xcol
.
If no confounder is selected, a simple 2D plot with the treatment on the x-axis is returned. Depending on marginal
the levels correspond either to the response surface (if FALSE
, default) or the marginal treatment effect/slope of response surface (if TRUE
).
The different confounder plots can be accessed using:
if plot3D = TRUE
and Xcol
specified: A 3D surface using plotly (if plotly
installed, otherwise plot3D defaults to FALSE). The treatment variable and the selected X[, Xcol]
are shown on the x- and y-axis, the outcome surface on the z-axis.
if plot3D = FALSE
and Xcol
specified: the treatment effect for different treatment levels using a (2D) contour plot with the treatment variable and the selected X[, Xcol]
on the x- and y-axis.
if no Xcol
specified: A 2D plot with treatment levels on the x- and the outcome on the y-axis.
1 2 3 |
object |
An |
Xcol |
A numeric. If missing plots the 2D graph of Y on Z. |
marginal |
A logical statement, default: |
plot3D |
A logical statement whether a three-dimensional plot should be produced. This is only valid if an X-column is selected and the plotly package is installed. |
show.observations |
A logical scalar that determines |
Xlim |
A two-dimensional vector with thelimits of the confounder dimension. |
Xstep |
A scalar for the step-size of the confounder dimension. |
Zlim |
A two-dimensional vector with thelimits of the treatment dimension. |
Zstep |
A scalar for the step-size of the treatment dimension. |
truefun |
A function handle for simulations. |
... |
Arguments handed to plotting function ( |
Note: The method is using a colorblind-robust palette as in http://jfly.iam.u-tokyo.ac.jp/color/#what.
Returns the plot object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.