Comparisons may be
specific
general s
at different levels
library(ggplot2)
library(gridExtra)
data(bank, package="gclus")
bank2 <- within(bank, st <- ifelse(Status==0,"genuine","forgery"))
c1 <- ggplot(bank2,aes(x=Diagonal)) +
geom_histogram(binwidth=0.2) + facet_grid(st~.)
c2 <- ggplot(bank2, aes(x=Right)) +
geom_histogram(binwidth=0.1) +facet_grid(st~.)
grid.arrange(c1, c2, ncol=2)
t.test(Right~ st,
data = bank2,var.equal = T)
##
## Two Sample t-test
##
## data: Right by st
## t = 10.196, df = 198, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 0.3815181 0.5644819
## sample estimates:
## mean in group forgery mean in group genuine
## 130.193 129.720
t.test(Diagonal ~ st,
data = bank2, var.equal = T)
##
## Two Sample t-test
##
## data: Diagonal by st
## t = -28.915, df = 198, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -2.207971 -1.926029
## sample estimates:
## mean in group forgery mean in group genuine
## 139.450 141.517
t-tests confirm that the differences in means between the two groups are highly significant.
The graphics show that the distribution patterns differ.