# Sample size justification for single group to get estimate of mean to desired accuracy

• I have a sample of computer components
• These computer components are made in batches (1 batch = 1 lot) of 200
• Component components can be individually tested electronically
• The result of this test is then averaged to give a lot-level value to pass or fail the entire lot
• I need to know how many components from a lot I need to sample, in order to get an accurate measure for this test for the WHOLE LOT.
• Does anyone know how I should justify this?
• For example, would testing 10 components give me an accurate enough estimate of the mean result from this test for the whole lot?

I know there are some unknowns here, like "accurate enough" - some sort of confidence interval perhaps?

Any help would be awesome!

Lincoln

• If you want the standard error of the mean to be smaller than some specific amount, you'd sample $n$ such that $\frac{\sigma}{\sqrt{n}}$ is less than that amount. If you don't know the population standard deviation, $\sigma$ or some good bound for it, but do have some information on the standard deviation from a random sample, you can get a large-sample value for the sample size $n$ that would achieve a kind of probabilistic bound. Similarly you can get confidence intervals of specified width, or a specific margin of error, involving a specific long run probability (across multiple samples) Commented Aug 2 at 8:31
• It might be useful to search for sample size and confidence interval to get an initial sense of the kind of information that would be needed. Commented Aug 2 at 8:50
• There is an extensive literature on statistical aspects of quality control. The US National Institute of Standards and Technology has a useful summary here. Without more details about what you are measuring (e.g., a dimension that needs to be within specifications versus a yes/no failure) and the expected characteristics from pilot studies (as @Glen_b suggested), it will be hard to provide useful help. Please edit the question to make the situation more specific.
– EdM
Commented Aug 2 at 13:25

To provide a complete answer, I repeat here the formula for the sample size $$n$$ required to estimate the population mean $$\mu$$ within a given margin or error $$\pm d$$, knowing the total population size $$N$$, and the population standard deviation $$\sigma$$.
$$n=\frac {1} {\frac {d^2} {z^2.\sigma^2}+\frac 1 N}$$
where $$z^2$$ is the critical value of the z distribution at $$\alpha/2$$ (or the well know $$1.96$$ for the "traditional" $$\alpha=.05$$).
For example, assuming $$\sigma=1$$ and the margin of error (MOE) is also 1 ($$d=1$$), with a population size of 200 (the OP's case), you get a sample size of 4 (3.81 to be exact, always rounded up).
Now, one problem is that this formula uses the z distribution; this assumes that the population standard deviation $$\sigma$$ is known. But it is not! All you have is an estimate based on your sample. So one should really use the critical values of the t distribution. But that value depends on the sample size (or rather on the degrees of freedom (d.f.) which $$n-1$$). So we have a self referential equation... This is solved via iterations. You start with the $$n$$ given by the z distribution, you reverse the equation to get $$d$$ as a function of $$n$$, you replace $$z$$ by $$t$$, and you keep increasing n, until the MOE $$d$$ gets below your target. For the same example as above, you now get $$n=7$$ (you will generally find that the "better" $$n$$, using the t distribution, is within a few counts of the one given by the $$z$$ distribution).
A second problem is the estimation of the standard deviation $$\sigma$$. You can use the one from your sample, but for some it will be less (good: you have a tighter estimate of the mean), but for others it will be worse (bad; your estimate will not be within your MOE). How do you deal with this? You can look at the historical data (after all, if you test every lot, you will quickly get a lot of data on the sampling distribution of the the s.d.), and pick a "worse case" (i.e. a value which is greater than e.g. 95% of the lots). You can use normal tolerance intervals on the values of the s.d. to determine this upper bound (and do not worry if your s.d.'s are not normally distributed; your answer will be close enough).