cdplot: Visualizing the experimental outcome with cumulative...

View source: R/cdplot.R

cdplotR Documentation

Visualizing the experimental outcome with cumulative distribution functions.

Description

Packed ggplot2 function to compare the empirical cumulative distribution functions (ECDF) between the treatment and control groups in an experiment or quasi-experiment.

Arguments

data

A data.frame including two columns, one recording the outcome and the other recording the assignment. The assignment column must be named as group.

ks_test

A logical option to indicate whether to show the Kolmogorov-Smirnov test result in the bottom-right corner. The default value is FALSE.

point_size

An integer to indicate the size of the points at the largest difference. The default value is 3.

point_color

An character or function to indicate the color of the points at the largest difference. The default value is drhutools::gb_cols("red").

link_color

An character or function to indicate the color of the link at the largest difference. The default value is drhutools::gb_cols("red").

Value

A list of ggplot2 objects comparing the ECDFs between the control and treatment groups and identifying at most three largest differences.

Examples


data("PlantGrowth")

plot_plant <- cdplot(PlantGrowth, ks_test = TRUE)
plot_plant


drhutools documentation built on April 4, 2025, 1:37 a.m.