How to compare one example with a sample of data? I realize that $t$-test are usually used to check for example if a sample belongs to the population, or if two samples are different.
What about if you have a sample of $n=200$ and you want to check what is the probability a new individual example is part of that sample. Or rather I just want to know where in the distribution of the sample the example is!
 A: This question is similar to the one in @StatsStudent's link, which you should read.
However, a major, and crucial, difference is that your comparison sample is much larger with $n = 200.$
Suppose you have a normal population $\mathsf{Norm}(\mu=100, \sigma=15)$ and an additional observation $X = 130.$ You can ask how likely it is
that the new observation might have come from that population. A
traditional answer, is that $P(X \ge 130) = P(Z > (130-100)/15 = 2)\approx 0.023.$ So if you interpret this as a P-value you'd say, probably not (if you like testing at the 5% level).
1 - pnorm(130, 100, 15)
[1] 0.02275013

1 - pnorm(2)            # std normal w/o extra parameters
[1] 0.02275013

Now suppose you have a sample of size $n = 200.$ Unknown to you it's from $\mathsf{Norm}(\mu=100, \sigma=15).$ You're willing to assume your new observation is from a population with the same variance as your sample of 200. Then you could do a pooled 2-sample t test, and you might
conclude the new observation could have come the same population because the P-value is 0.078 (if you
like testing at the 5% level).
set.seed(2020)
x2 = rnorm(200, 100, 15)
t.test(130, x2, var.eq = T)

        Two Sample t-test

data:  130 and x2
t = 1.7697, df = 199, p-value = 0.0783
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -3.433716 63.535081
sample estimates:
mean of x mean of y 
130.00000  99.94932 

Somewhat more than half of similar reference groups would lead
to rejection:
set.seed(2020)
x = 130
pv = replicate(10^5, t.test(x, rnorm(200,100,15), var.eq=T)$p.val)
mean(pv <= 0.05)
[1] 0.58711

