# Sample size vs Number of samples in calculating standard error

Suppose a survey was given to 100 people (the response is just a number between 0 and 1) and only the mean was reported. So 1 sample was taken with n = 100.

Now suppose this was repeated 20 times. So I have a list of means with 20 entries. It's my understanding that I can estimate the population mean and variance by the mean and variance of this list. (Right?)

Given that the # of total people available to survey is infinite, but that the maximum # of times we are allowed to take a survey is 200, my questions are:

Do we calculate standard error as: $SE = \frac{\sigma}{\sqrt{n}}$, where n = 100 or n = 20? Do I use the sample size, or number of samples as $n$?

How does the SE change when increasing sample size vs number of samples... for example what would be the difference of surveying 150 people 20 times vs. surveying 100 people 30 times? (Keeping in mind we only know the mean of each survey)

I'm a bit confused by the wording of this question, but I'm going to take what I think is the most likely interpretation and answer that.

First, $$n$$ in the standard error of the mean formula, $$SE = \frac{\sigma}{\sqrt{n}}$$ is always the sample size. If you have a sample of $$n$$ people, and you're using the mean of that sample as an estimator of the true mean of the population from which those people are drawn, the standard error of that estimate is $$\frac{\sigma}{\sqrt{n}}$$.

Now, you say this "was repeated 20 times". I take this to mean that you have 20 independent samples from the same population, with 100 people in each sample, rather than collecting repeat-measures data from the same 100 people. If we can assume that these samples are exchangeable (there are no systematic differences between the samples), we could go ahead and treat this as one large sample, with $$n = 100\times 20 = 2000$$.

However, maybe we have reason to believe the samples may differ from each other. In this case, it makes more sense to model your data hierarchically, using linear mixed models. The basic form of this model would be:

• There is an overall population-level true mean - call it $$\theta$$.
• Each sample has its own sample-level true mean, which we'll call $$\mu_i$$, where the $$i$$ subscript indicates the sample number.
• Assume that sample true means are normally distributed around the population true mean with some standard deviation $$\sigma_{\mu}$$: $$\mu_i \sim \text{Normal}(\theta, \sigma_{\mu})$$
• Assume that individual data points are normally distributed around their true sample mean: $$x_i \sim \text{Normal}(\mu_i, \sigma_{x})$$

This sounds like a lot, but it's easily estimated using the lme4 package in R: model = lmer(x ~ 1 + (1|sample), data = your_data), which you can find plenty of documentation for.

How does the SE change when increasing sample size vs number of samples... for example what would be the difference of surveying 150 people 20 times vs. surveying 100 people 30 times? (Keeping in mind we only know the mean of each survey)

It should be clear from what's above that the answer to this question depends on both the variability between samples $$\sigma_{\mu}$$ and the variability within samples, $$\sigma_x$$. Unfortunately, I don't have time today to go into more detail!