I have drawn a sample from a population. For an hour I have asked all the visitors to a website their age.

population = people in Germany
sample = 32 German visitors to the website

(international visitors were excluded)

Now I want to know if there are any abnormalities in the age distribution of this sample. When I look at the data, the ages seem not to be represented uniformly, so I could form the hypothesis that in my sample a certain age is overrepresented (e.g. middle-aged men and women visit the website more often than people of other ages):

Histrogram and Density Curve of Age Distribution in Sample

I could test this hypothesis with a statistical test, assuming an underlying normal distribution and would probably find that my sample doesn't deviate significantly from a normal distribution.

But when I look at the population pyramid of Germany, I notice that ages aren't distributed normally in my population (men are blue, women violet in this diagram):

Histogram of Age Distribution of Population

Visually comparing my sample distribution to this population distribution I notice that my sample is missing the second modus ("summit") around age 30, so there might be a significant deviation of my sample from the population that does not become apparent when I test the sample against an assumed normal distribution.

In a case like this, where we know the true distribution of the population (age data for Germany are publicly available) and don't have to work with possibly wrong assumptions:

How do I test a hypothesis against the true population distribution?

Is there a statistical test that allows me to input true, irregularly distributed population data as the comparison distribution?


I do understand that my sample is too small for a test to have sufficient statistical power. Please ignore this for the purpose of this question.

  • $\begingroup$ Can you generate a PDF / CDF of the population distribution? $\endgroup$ Jan 28, 2019 at 13:07
  • $\begingroup$ @user2974951 Yes, of course. $\endgroup$
    – user235489
    Jan 28, 2019 at 13:30

1 Answer 1


Such an analysis may or may not be sensible. Given that you are "sampling" on the internet, and even more specifically you are sampling on one website, it is unlikely that your your sample will be representative of the population. Very old or very young people do not really "browse" the internet. Or, imagine that your website sells funeral caskets, then it is obvious to everyone that the people that visit your website are clearly not representative of the population.

Nonetheless, if the points mentioned above do not apply to you and you would still like to perform some sort of test... you could try a Goodness of fit $\chi^2$ test... if you would be able to describe your population distribution accurately enough with a PDF / CDF.

Personally, my first choice would be a bootstrap approach, that is sample at random a large number of samples from your population with size 30 (in your case, given your sample size), and then check how similar these samples are to your original sample. Maybe even compare the original sample mean and standard deviation (or some other such metric) with the bootstrap samples, so a sort of permutation test.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.