# Sample Within a Sample

So I have a very large set of data for adding one chemical to another (say adding X to Y) (about a years worth of data so not the entire population, about 87,000 data points). Currently we have an upper and lower limit on the concentration of chemical X in chemical Y. We would like to make our target concentration as close to the lower limit as possible without causing quality issues. Sometimes we mix batches where there would only be about 3 to 20 sample points, so I would like to prove with a certain level of confidence that if I took a random sample (about size 3 to 20) from within that larger sample, the mean of the concentration of chemical X would be above the lower limit. What kind of test should I perform?

Note that the injection of chemical x into chemical y is automated and has some variability, which is why we are doing statistics on it.

• Why? Provide context. – Kodiologist Feb 27 '17 at 18:58
• @Kodiologist See the post I updated with context. – user7128260 Feb 27 '17 at 19:10

The most straightforward way to do this is with simulation. Let $B$ be some large integer; say, 10,000. For each $n = 3, 4, … 20$, randomly select $B$ samples of size $n$ from your full dataset and calculate what proportion of these samples have the mean concentration of chemical X above the lower limit. For each $n$, this proportion is an estimate of the probability that a random sample of size $n$ will have a mean concentration above the lower limit.