|
| 1 | +#' Compute a contrast between two outcome prediction specifications for a BCF model |
| 2 | +#' |
1 | 3 | #' Compute a contrast using a BCF model by making two sets of outcome predictions and taking their difference. |
2 | 4 | #' For simple BCF models with binary treatment, this will yield the same prediction as requesting `terms = "cate"` |
3 | 5 | #' in the `predict.bcfmodel` function. For more general models, such as models with continuous / multivariate treatments or |
@@ -245,6 +247,8 @@ compute_contrast_bcf_model <- function( |
245 | 247 | } |
246 | 248 | } |
247 | 249 |
|
| 250 | +#' Compute a contrast between two outcome prediction specifications for a BART model |
| 251 | +#' |
248 | 252 | #' Compute a contrast using a BART model by making two sets of outcome predictions and taking their difference. |
249 | 253 | #' This function provides the flexibility to compute any contrast of interest by specifying covariates, leaf basis, and random effects |
250 | 254 | #' bases / IDs for both sides of a two term contrast. For simplicity, we refer to the subtrahend of the contrast as the "control" or |
@@ -830,7 +834,8 @@ posterior_predictive_heuristic_multiplier <- function( |
830 | 834 |
|
831 | 835 | #' Compute posterior credible intervals for BCF model terms |
832 | 836 | #' |
833 | | -#' This function computes posterior credible intervals for specified terms from a fitted BCF model. It supports intervals for prognostic forests, CATE forests, variance forests, random effects, and overall mean outcome predictions. |
| 837 | +#' Compute posterior credible intervals for specified terms from a fitted BCF model. Supports intervals for prognostic forests, CATE forests, variance forests, random effects, and overall mean outcome predictions. |
| 838 | +#' |
834 | 839 | #' @param model_object A fitted BCF model object of class `bcfmodel`. |
835 | 840 | #' @param terms A character string specifying the model term(s) for which to compute intervals. Options for BCF models are `"prognostic_function"`, `"mu"`, `"cate"`, `"tau"`, `"variance_forest"`, `"rfx"`, or `"y_hat"`. Note that `"mu"` is only different from `"prognostic_function"` if random effects are included with a model spec of `"intercept_only"` or `"intercept_plus_treatment"` and `"tau"` is only different from `"cate"` if random effects are included with a model spec of `"intercept_plus_treatment"`. |
836 | 841 | #' @param level A numeric value between 0 and 1 specifying the credible interval level (default is 0.95 for a 95% credible interval). |
@@ -1055,7 +1060,10 @@ compute_bcf_posterior_interval <- function( |
1055 | 1060 | } |
1056 | 1061 | } |
1057 | 1062 |
|
1058 | | -#' Compute posterior credible intervals for specified terms from a fitted BART model. It supports intervals for mean functions, variance functions, random effects, and overall predictions. |
| 1063 | +#' Compute posterior credible intervals for specified terms from a fitted BART model. |
| 1064 | +#' |
| 1065 | +#' Compute posterior credible intervals for specified terms from a fitted BART model. Supports intervals for mean functions, variance functions, random effects, and overall outcome predictions. |
| 1066 | +#' |
1059 | 1067 | #' @param model_object A fitted BART or BCF model object of class `bartmodel`. |
1060 | 1068 | #' @param terms A character string specifying the model term(s) for which to compute intervals. Options for BART models are `"mean_forest"`, `"variance_forest"`, `"rfx"`, or `"y_hat"`. |
1061 | 1069 | #' @param level A numeric value between 0 and 1 specifying the credible interval level (default is 0.95 for a 95% credible interval). |
|
0 commit comments