This is a classification problem. If you want to find single value that marks the threshold that let's you to divide your data into two groups, then the most standard approach to problem as yours is to use decision tree. Decision tree algorithm splits your data into branches given the predictors such that the resulting split leads to most accurate classification.
Blow you can see usage of R's rpart
function on some made-up data. It does exactly what you want: finds threshold value that let's you to classify the data into two groups. Of course, in more complicated cases the tree could have more levels and you'd need to prune it.
library(rpart)
set.seed(123)
n <- 50
x <- rnorm(n, 1)
y <- rnorm(n, 3)
dat <- data.frame(
predictor = c(x,y),
group = factor(rep(letters[1:2], each = 50))
)
(fit <- rpart(group ~ predictor, data = dat, method = "class")))
## n= 100
##
## node), split, n, loss, yval, (yprob)
## * denotes terminal node
##
## 1) root 100 50 1 (0.50000000 0.50000000)
## 2) predictor< 1.911667 46 3 a (0.93478261 0.06521739) *
## 3) predictor>=1.911667 54 7 b (0.12962963 0.87037037) *
On the plot below you can see distributions of both variables with marked decision threshold.
Notice that this is something different then hypothesis testing. In case of using hypothesis test such as $t$-test you ask yourself if means of both groups significantly differ. In case of classification you do not care if there is any difference at all, just look for the best model that minimizes some loss function (even though is can be a really poor model in some cases).