I have a list of ages and then a binary value associated with it (e.g. is the person overweight)

I would like to calculate from this the p-value.

I have plotted the values and then calculated the probability that at a certain age the person is overweight, but I don't think this is the p-value.

  • 1
    $\begingroup$ p-values are usually discussed in the context of an experiment, but I don't see anything indicating that you are comparing two groups. Perhaps you misunderstand the nature of hypothesis testing and p-values? en.wikipedia.org/wiki/Statistical_hypothesis_testing $\endgroup$ Jan 10, 2019 at 16:38

1 Answer 1


P-values are used to provide insight into the solidity or likeliness of your results within the framework of a pre-determined hypothesis. Therefore, in order to determine the p-value, first you'll need to identify what you are curious about within the scope of the problem and develop a hypothesis test that mirrors that question.

For example, let's re-frame your data such that we have a clear question that we are trying to answer:

We have a sample of individuals and are given their ages and whether or not they are considered overweight based on their weight being above or below some threshold. Given this data, I would like to know if people who are overweight tend to be of a higher age than people who are not overweight. Given this question, I can then construct the following hypothesis in which $\mu(x)$ is the population mean age of overweight individuals and $\mu(y)$ is the population mean age of non-overweight individuals:

$$H_{0}: \mu_{x} = \mu_{y}$$

$$H_{A}: \mu_{x} > \mu_{y}$$

From there, based on the distribution of your data, you will be able to find the p-value, which is the "probability of observing a result equal or more extreme in your sample, assuming that the null hypothesis is true. If we observe a very small p-value (usually smaller than 0.05), then it is unlikely that our null hypothesis was true. Conversely, with a large p-value, we would "fail to reject" the null hypothesis that the mean ages are equal.


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.