plot_uni_compare {sampcompR} | R Documentation |
plot univar data
Description
plot_uni_compare
This uses ggplot2 to generate a plot based on an object
generated by the uni_compare
function.
Usage
plot_uni_compare(
uni_compare_objects,
name_dfs = NULL,
name_benchmarks = NULL,
summetric = NULL,
colors = NULL,
shapes = NULL,
legendlabels = NULL,
legendtitle = NULL,
label_x = NULL,
label_y = NULL,
summet_size = NULL,
plot_title = NULL,
conf_adjustment = FALSE,
varlabels = NULL,
ndigits = 3
)
Arguments
uni_compare_objects |
A object generated by the |
name_dfs , name_benchmarks |
A character string or vector of character strings containing the new names of the data frames and the benchmarks, that are used in the plot. |
summetric |
If |
colors |
A vector of colors that is used in the plot for the different comparisons. |
shapes |
A vector of shapes applicable in |
legendlabels |
A character string or vector of strings containing a label for the legend. |
legendtitle |
A character string containing the title of the legend. |
label_x , label_y |
A character string or vector of character strings containing a label for the x-axis and y-axis. |
summet_size |
A number to determine the size of the displayed
|
plot_title |
A character string containing the title of the plot. |
conf_adjustment |
If |
varlabels |
A character string or vector of character strings containing the new names of the variables, also used in plot. |
ndigits |
The number of digits to round the numbers in the plot. |
Value
Plot of a uni_compare
object using
ggplot2::ggplot2()
which shows the difference between two or more data
frames.
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
univar_data<-sampcompR::uni_compare(dfs = c("north","white"),
benchmarks = c("south","black"),
variables= c("age","educ","fatheduc","motheduc","wage","IQ"),
funct = "abs_rel_mean",
nboots=0,
summetric="rmse2",
data=TRUE)
sampcompR::plot_uni_compare(univar_data)