plot_multi_compare {sampcompR} | R Documentation |
Plot Multiple multi_compare_objects
Description
plot_multi_compare
plots multipe multi_compare_objects
together.
Usage
plot_multi_compare(
multi_compare_objects,
plots_label = NULL,
plot_title = NULL,
p_value = 0.05,
breaks = NULL,
plot_data = FALSE,
colors = NULL,
variant = "one",
p_adjust = NULL,
note = FALSE,
grid = "white",
diff_perc = TRUE,
diff_perc_size = 4.5,
ncol_facet = 3,
perc_diff_transparance = 0,
diff_perc_position = "top_right",
gradient = FALSE,
sum_weights_indep = NULL,
sum_weights_dep = NULL,
label_x = NULL,
label_y = NULL,
missings_x = TRUE
)
Arguments
multi_compare_objects |
A character vector containing the names of one or more |
plots_label |
A character vector of the same lengths as |
plot_title |
A string containing the title of the visualization. |
p_value |
A number between zero and one, that is used as p-value in significance analyses. |
breaks |
A vector, containing several of strings, to rename the categories in the legend.
Its possible length depends on the |
plot_data |
A logical value. If |
colors |
A vector of colors, usable in ggplot, for every break. It's possible length depends on the |
variant |
Variant can be either "one", "two", "three","four","five", or "six".
|
p_adjust |
If |
note |
A logical value. If |
grid |
A string, that can either be "none" or a color, for the edges of every tile. If "none", no grid will be displayed. |
diff_perc |
A logical value. If |
diff_perc_size |
A number to decide the size of the text in |
ncol_facet |
A number of columns used in faced_wrap() for the plots. |
perc_diff_transparance |
A number between zero and one, to decide the background transparency of |
diff_perc_position |
A character string, to choose the position of |
gradient |
A logical Value. If |
sum_weights_indep , sum_weights_dep |
A vector of weights for every
dependent or independent variable. Must be |
label_x , label_y |
A character string or vector of character strings containing a label for the x-axis and y-axis. |
missings_x |
If |
Value
Returns a a heat matrix-like plot created with ggplot, to visualize
the multivariate differences. If multiple objects are used, they will be
displayed separately with ggplot's facet_wrap function. On the y-axis, the
independent variables are displayed, while on the x-axis the independent
variables are displayed. Depending on the variant, the displayed tile colors
must be interpreted differently. FALSEor more information on interpretation look
at variant
.
Examples
## Get Data for comparison
require(wooldridge)
card<-wooldridge::card
south <- card[card$south==1,]
north <- card[card$south==0,]
black <- card[card$black==1,]
white <- card[card$black==0,]
## use the function to plot the data
multi_data1 <- sampcompR::multi_compare(df = north,
bench = south,
independent = c("age","fatheduc","motheduc","IQ"),
dependent = c("educ","wage"),
family = "ols")
multi_data2 <- sampcompR::multi_compare(df = black,
bench = white,
independent = c("age","fatheduc","motheduc","IQ"),
dependent = c("educ","wage"),
family = "ols")
plot_multi_compare(c("multi_data1","multi_data2"))