Learn R Programming

OPSR (version 1.0.1)

opsr_te: Treatment Effect Computations for OPSR Model Fits

Description

Treatment Effect Computations for OPSR Model Fits

Usage

opsr_te(
  object,
  type = c("response", "unlog-response", "prob", "mills", "correction", "Xb"),
  weights = NULL,
  ...
)

Value

An object of class "opsr.te".

Arguments

object

object an object of class "opsr".

type

see predict.opsr for details.

weights

a vector of weights. If NULL then weights from object will be used.

...

additional arguments passed to predict.opsr.

Details

This function only prepares the input to a further call to summary.opsr.te.

See Also

summary.opsr.te

Examples

Run this code
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)

Run the code above in your browser using DataLab