plot_overlap_pScores: Plot the overlap via propensity score method

View source: R/plot_overlap_pScores.R

plot_overlap_pScoresR Documentation

Plot the overlap via propensity score method

Description

Plot histograms showing the overlap between propensity scores by treatment status.

Usage

plot_overlap_pScores(
  .data,
  treatment,
  confounders,
  plot_type = c("histogram", "density"),
  trim = TRUE,
  min_x = NULL,
  max_x = NULL,
  pscores = NULL,
  ...
)

Arguments

.data

dataframe

treatment

character. Name of the treatment column within .data

confounders

character list of column names denoting confounders within .data

plot_type

the plot type, one of c('Histogram', 'Density')

trim

a logical if set to true y axis will be trimmed to better visualize areas of overlap

min_x

numeric value specifying the minimum propensity score value to be shown on the x axis

max_x

numeric value specifying the maximum propensity score value to be shown on the x axis

pscores

propensity scores. If not provided, then propensity scores will be calculated using BART

...

additional arguments passed to 'dbarts::bart2' propensity score calculation

Value

ggplot object

Author(s)

George Perrett, Joseph Marlo

See Also

plot_overlap_vars

Examples


data(lalonde)
plot_overlap_pScores(
 .data = lalonde,
 treatment = 'treat',
 confounders = c('age', 'educ'),
 plot_type = 'histogram',
 pscores = NULL,
 seed = 44
)


joemarlo/plotBart documentation built on May 31, 2024, 12:22 p.m.