plot_Y_AB: Plot the estimated cdf of Y_A and Y_B or their difference

View source: R/RVCompare.R

plot_Y_ABR Documentation

Plot the estimated cdf of Y_A and Y_B or their difference

Description

retunrs a ggplot2 with the estimations of Y_A and Y_B or the difference in cumulative distribution function.

Usage

plot_Y_AB(
  estimated_Y_AB_bounds,
  labels = c("X_A", "X_B"),
  plotDifference = TRUE
)

Arguments

estimated_Y_AB_bounds

the bounds estimated with get_Y_AB_bounds_bootstrap or get_Y_AB_bounds_DKW.

labels

(optional, default=c("X_A","X_B")) a string vector of length 2 with the labels of X_A and X_B, in that order.

plotDifference

(optional, default=TRUE) plots the difference (Y_A - Y_B) instead of each of the random variables on their own.

Value

the ggplot figure object.

Examples

### Example 1 ###

X_A_observed <- rnorm(800,mean = 1, sd = 1)
X_B_observed <- rnorm(800,mean = 1.3, sd = 0.5)
res <- get_Y_AB_bounds_DKW(X_A_observed, X_B_observed)
densitiesPlot = plot_Y_AB(res, plotDifference=TRUE)
print(densitiesPlot)

RVCompare documentation built on Aug. 21, 2023, 5:13 p.m.