Skip to contents

Plot function for sps

Usage

sps_plot(out, title = NULL, columns = NULL, before_selection = FALSE, X = NULL)

Arguments

out

Output from function sps(). When before_selection = TRUE, set this argument to be NULL.

title

Title of the plot

columns

(Optional. Default = NULL) Names of columns users want to visualize. When NULL, the function plots every column.

before_selection

Logical (TRUE or FALSE. Default = FALSE). When FALSE, the function will compare selected and non-selected sites. When TRUE, the function simply visualizes the distribution of site-level variables in the target population of sites.

X

(Optional. Use this only when before_selection = TRUE.) Site-level variables for the target population of sites.

Value

sps_plot visualizes the distribution of site-level variables.

References

Egami and Lee. (2023+). Designing Multi-Context Studies for External Validity: Site Selection via Synthetic Purposive Sampling. Available at https://naokiegami.com/paper/sps.pdf.