pairs.opsr.te {OPSR}R Documentation

Pairs Plot for OPSR TE Objects

Description

Pairs Plot for OPSR TE Objects

Usage

## S3 method for class 'opsr.te'
pairs(
  x,
  pch = 21,
  labels.diag = paste0("T", 1:x$nReg),
  labels.reg = paste0("G", 1:x$nReg),
  col = 1:x$nReg,
  add.rug = TRUE,
  lower.digits = 0,
  diag.digits = 0,
  lwd.dens = 1.5,
  diag.cex.text = 1,
  upper.digits = 2,
  upper.cex.text = 2,
  prefix = "",
  postfix = "",
  lty.diag = 1,
  ...
)

Arguments

x

an object of class "opsr.te".

pch

plotting 'character', i.e., symbol to use. See also pch.

labels.diag

labels used in the diagonal panels.

labels.reg

labels for the treatment regimes.

col

colour vector.

add.rug

if TRUE, adds rugs to the lower panels.

lower.digits

rounding of the digits in the lower panel.

diag.digits

rounding of the digits in the diagonal panel.

lwd.dens

linewidth of the densities in the diagonal panel.

diag.cex.text

cex for the text in the diagonal panel.

upper.digits

rounding of the digits in the upper panel.

upper.cex.text

cex for the text in the upper panel.

prefix

for the number plotted in the upper panel.

postfix

for the number plotted in the upper panel.

lty.diag

linetype for the diagonal panel.

...

further arguments passed to or from other methods.

Details

Presents all potential counterfactual outcomes. The diagonal depicts distributions in any given treatment regime and separate by the current (factual) treatment group. The weighted mean values are shown as red numbers. The lower triangular panels compare the model-implied (predicted) outcomes of two treatment regimes again separate by current treatment group. The red line indicates the 45-degree line of equal outcomes while the red squares depict again the weighted mean values. The upper triangular panels show (weighted) average treatment effects.

Value

Returns x invisibly.

See Also

pairs

Examples

sim_dat <- opsr_simulate()
dat <- sim_dat$data
weights <- runif(nrow(dat))
fit <- opsr(ys | yo ~ xs1 + xs2 | xo1 + xo2, dat = dat, weights = weights,
            printLevel = 0)
te <- opsr_te(fit, type = "response")
print(te)
summary(te)

te_w <- opsr_te(fit, type = "response", weights = rep(1, nrow(dat)))
summary(te_w)

pairs(te)

[Package OPSR version 1.0.0 Index]