Plot histograms showing the overlap between variables by treatment status.

## Usage

plot_overlap_vars(
.data,
treatment,
confounders,
plot_type = c("histogram", "density"),
min_x = NULL,
max_x = 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'). Defaults to 'histogram'

min_x

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

max_x

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

## Value

ggplot object

plot_overlap_pScores

## Author

George Perrett, Joseph Marlo

## Examples

data(lalonde)
plot_overlap_vars(
.data = lalonde,
treatment = 'treat',
confounders = c('age', 'educ'),
plot_type = 'Histogram'
)
#> stat_bin() using bins = 30. Pick better value with binwidth.
#> stat_bin() using bins = 30. Pick better value with binwidth.
{"ft_lang_label":"__label__en","ft_lang_prob":0.70753694,"math_prob":0.957396,"size":689,"snap":"2023-40-2023-50","text_gpt3_token_len":169,"char_repetition_ratio":0.12992701,"word_repetition_ratio":0.083333336,"special_character_ratio":0.22496371,"punctuation_ratio":0.15929204,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9590793,"pos_list":[0,1,2],"im_url_duplicate_count":[null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-05T14:55:28Z\",\"WARC-Record-ID\":\"<urn:uuid:3725b7d9-5bc2-4b29-b671-f7aa904d3a4e>\",\"Content-Length\":\"11133\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:c0df146f-2f79-447b-a538-cddc386cbf48>\",\"WARC-Concurrent-To\":\"<urn:uuid:fb8b6c9e-94b8-4c07-9a4c-e23bb78d39bf>\",\"WARC-IP-Address\":\"185.199.111.153\",\"WARC-Target-URI\":\"https://priism-center.github.io/plotBart/reference/plot_overlap_vars.html\",\"WARC-Payload-Digest\":\"sha1:6LA65OL5K76DCFY3FPTZ4VP6NRHETRHB\",\"WARC-Block-Digest\":\"sha1:6HV42JNIZFLFATH7OAGT75SZA2XLX3FC\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100551.2_warc_CC-MAIN-20231205140836-20231205170836-00382.warc.gz\"}"}