generics: Generic Methods for 'bartcFit' Objects

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Visual exploratory data analysis and model fitting diagnostics for causal inference models fit using the bartc function.

Usage

 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,
                           ...)

Arguments

object

Object of class bartcFit.

value

Which quantity to return. See details for a description of possible values.

sample

Return information for either the "inferential" (e.g. treated observations when the estimand is att) or "all" observations.

combineChains

If the models were fit with more than one chain, results retain the chain structure unless combineChains is TRUE.

newresp

Not presently used, but provided for compatibility with other definitions of the refit generic.

newdata

Data corresponding to the confounders in a bartc fit.

commonSup.rule, commonSup.cut

As in bartc

...

Additional parameters passed up the generic method chain.

Details

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:

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.

Value

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.

For refit, an object of class bartcFit.

Author(s)

Vincent Dorie: vdorie@gmail.com.

See Also

bartc

Examples

1
## fit a simple linear model

lurui0421/BartCause documentation built on July 4, 2019, 1:02 p.m.