plot.BalanceR | R Documentation |
Plot "BalanceR" Object
## S3 method for class 'BalanceR' plot( x, point.size = 2.5, text.size = 12, vline = c(10, 25), color = TRUE, simplify = FALSE, abs = FALSE, compare = NULL, names = NULL, ... )
x |
An object of class "BalanceR" |
point.size |
Size of points in the plot. Default is 2.5. |
text.size |
Size of texts in the plot. Default is 12. |
vline |
Numeric vector denoting x-intercept of vertical lines. Default is |
color |
If |
simplify |
Display maximum standardized biases. When number of pairs is large, I recommend set this argument TRUE. Default is FALSE. If |
abs |
Display absolute values of standardized biases. Default is FALSE. |
compare |
An object of class "BalanceR". Default is NULL. |
names |
Name of objects |
... |
Ignored. |
Jaehyun Song <http://www.jaysong.net>
BalanceR
, print.BalanceR
## Not run: ## S3 method for class 'BalanceR' library(BlcDF) ## Show a plot BlcChk <- BlcDF %>% BalanceR(group = Group, cov = c(Sex, Age, Educ, Marriage)) plot(BlcChk) ## A pipe operator (%>%) is also available. library(magrittr) BlcChk %>% plot() ## Show a plot with vertical lines BlcChk %>% plot(vline = c(3, 5, 10)) ## Change text and point sizes BlcChk %>% plot(point.size = 3, text.size = 12) ## Display only absolute values of maximum standardized biases. BlcChk %>% plot(only.SB = TRUE, abs = TRUE, simplify = TRUE) ## Display black-white plot BlcChk %>% plot(color = FALSE) ## Compare two BalanceR objects BlcChk1 <- BlcDF[1:1000, ] %>% BalanceR(group = Group, cov = c(Sex, Age, Educ, Marriage)) BlcChk2 <- BlcDF[1001:2000, ] %>% BalanceR(group = Group, cov = c(Sex, Age, Educ, Marriage)) plot(BlcChk1, compare = BlcChk2, names = c("First 1000 Sample", "Second 1000 Sample"), abs = TRUE, point.size = 3, color = FALSE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.