Description Usage Arguments Details Value Author(s) See Also Examples
Visual exploratory data analysis and model fitting diagnostics for causal inference models fit
using the bartc
function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ## S3 method for class 'bartcFit'
fitted(object,
value = c("est", "y", "y0", "y1", "indiv.diff", "p.score", "p.weights"),
sample = c("inferential", "all"),
...)
extract(object, ...)
## S3 method for class 'bartcFit'
extract(object,
value = c("est", "y", "y0", "y1", "indiv.diff", "p.score", "p.weights"),
sample = c("inferential", "all"),
combineChains = TRUE,
...)
refit(object, newresp, ...)
## S3 method for class 'bartcFit'
refit(object,
newresp = NULL,
commonSup.rule = c("none", "sd", "chisq"),
commonSup.cut = c(NA_real_, 1, 0.05),
...)
predict(object, newdata, ...)
## S3 method for class 'bartcFit'
predict(object,
newdata,
value = c("y1", "y0", "indiv.diff", "p.score"),
combineChains = TRUE,
...)
|
object |
Object of class |
value |
Which quantity to return. See details for a description of possible values. |
sample |
Return information for either the |
combineChains |
If the models were fit with more than one chain, results retain the chain structure unless
|
newresp |
Not presently used, but provided for compatibility with other definitions of the |
newdata |
Data corresponding to the confounders in a |
commonSup.rule, commonSup.cut |
As in |
... |
Additional parameters passed up the generic method chain. |
fitted
returns the values that would serve as predictions for an object returned by the
bartc
function, while extract
instead returns the full matrix or array of posterior
samples. The possible options are:
"est"
- the estimate itself, e.g. ATE
"y"
- predictions under the observed treatment condition, i.e.
\hat{y}_i(1) * z_i + \hat{y}_i(0) * (1 - z_i).
"y0"
- predictions for all observations under the control
"y1"
- predictions for all observations under the treatment
"indiv.diff"
- for all observations the individual treatment effect estimates, i.e.
\hat{y}_i(1) \hat{y}_i(0).
"p.score"
- probability that each observation is assigned to the treatment group
"p.weights"
- weights assigned to each individual difference if the response method
is "p.weight"
refit
exists to allow the same regressions to be used to calculate estimates under different
common support rules. To refit those models on a subset, see the examples in bartc
.
predict
allows the fitted model to be used to make predictions on an out-of-sample set.
Requires model to be fit with keepTrees
equal to TRUE
.
For fitted
, extract
, and predict
, a matrix, array, or vector depending on the
dimensions of the result and the number of chains. For the following, when n.chains
is one
the dimension is dropped.
"est"
- when fitted
, a scalar; when extract
, n.samples x n.chains
"y"
, "y0"
, "y1"
, "indiv.diff"
, "p.weights"
- when
fitted
, a vector of length equal to the number of observations (n.obs
); when
extract
or predict
, a matrix or array of dimensions n.obs x n.samples x n.chains
.
"p.score"
- depending on the fitting method, samples may or not be present. When samples
are absent, a vector is returned for both functions. When present, the same as "y"
.
For refit
, an object of class bartcFit
.
Vincent Dorie: vdorie@gmail.com.
1 | ## fit a simple linear model
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.