#Two group estimation stats plot
#Data has one column that is a text vector denoting group (Control, Treatment; here: x)
#And a second column with continuous outcome (here: y)

library(dabestr)

unpaired_meandiff<-dabest(dabestdat, x, y, paired = FALSE,
idx=c("control","treatment")) %>%
mean_diff(ci = 95, reps = 5000, seed = 12345) #reps and seed refer to bootstrapping

# Display the results in a user-friendly format.
unpaired_meandiff
## dabestr (Data Analysis with Bootstrap Estimation in R) v0.3.0
## =============================================================
##
## Good afternoon!
## The current time is 16:40 PM on Tuesday October 13, 2020.
##
## Dataset : dabestdat
## X Variable : x
## Y Variable : y
##
## Unpaired mean difference of treatment (n = 50) minus control (n = 50)
## 11.2 [95CI 8.18; 14.6]
##
##
## 5000 bootstrap resamples.
## All confidence intervals are bias-corrected and accelerated.
# Produce a Cumming estimation plot.
plot(unpaired_meandiff)