I worked through the question based on two examples. The first was my older daughter which was initially quite long/tall.
Girl Age 49 days, 60 cm
divide by 30.4375 = 1.61 months
So that's between month 1 and month 2:
Month P01 P1 P3 P5 P10 P15 P25 P50 P75 P85 P90 P95 P97 P99 P999
1 47.6 49.1 50 50.5 51.2 51.7 52.4 53.7 55 55.7 56.2 56.9 57.4 58.2 59.7
2 50.8 52.3 53.2 53.7 54.5 55 55.7 57.1 58.4 59.2 59.7 60.4 60.9 61.8 63.4
subtract the lower month: 1.61 - 1 = 0.61
So the value is 61% the way to month 2.
I would get a percentile line for this by linear interpolation
For each percentile I can interpolate values from the month row before and after it.
e.g. for P01
p1 = 47.6, p2 = 50.8
P01 = p1 * (1.0 - 0.61) + p2 * (0.61)
P01 = 18.564 + 30.988 = 49,552
Month P01 P1 P3 P5 P10 P15 P25 P50 P75 P85 P90 P95 P97 P99 P999
1 47.6 49.1 50.0 50.5 51.2 51.7 52.4 53.7 55.0 55.7 56.2 56.9 57.4 58.2 59.7
2 50.8 52.3 53.2 53.7 54.5 55.0 55.7 57.1 58.4 59.2 59.7 60.4 60.9 61.8 63.4
1.6 49.552 51.052 51.952 52.452 53.213 53.713 54.413 55.774 57.074 57.835 58.335 59.035 59.535 60.396 61.957
60 cm is between 59,535 (P97) and 60,396 (P99).
0.465 away from the lower, 0.396 away from the higher value.
0.465 is 54% of the distance between them (0,861)
P = (1-0.54) * 97 + 0.54 * 99 = 44.62 + 53.46 = 98,08
Rounded P98
Turns out that this is a bad example. At the extremes the percentiles are very closely spaced so that linear interpolation would give similar results. But my problem is that linear interpolation in the middle is inaccurate. Let’s do a better example. This time with my second daughter who was more in the „middle of the road“ after birth.
Girl Age 119 days, 60.5 cm
divide by 30.4375 = 3.91 months - so we interpolate between month 3 and month 4:
Month P01 P1 P3 P5 P10 P15 P25 P50 P75 P85 P90 P95 P97 P99 P999
3 53.3 54.9 55.8 56.3 57.1 57.6 58.4 59.8 61.2 62.0 62.5 63.3 63.8 64.7 66.3
4 55.4 57.1 58.0 58.5 59.3 59.8 60.6 62.1 63.5 64.3 64.9 65.7 66.2 67.1 68.8
3.91 55.211 56.902 57.802 58.302 59.102 59.602 60.402 61.893 63.293 64.093 64.684 65.484 65.984 66.884 68.575
60.5 cm is between 60.402 (P25) and 61.893 (P50)
0.098 of the distance 1.491 = 6.6%
P = 25 * (1-0.066) + 50 * 0.066 = 23.35 + 3.3 = 26.65
round up to P27
To compare that to approximating it on a bell curve, I used an online calculator/plotter:
This needed a mean and a standard deviation, which I think I found on the percentile table left-most columns. But I also need to interpolate these for month 3.91:
Month L M S SD
3 1.0 59.8029 0.0352 2.1051
4 1.0 62.0899 0.03486 2.1645
3.91 1.0 61.88407 0.0348906 2.159154
I have no idea what L and S mean, but M probably means MEAN and SD probably means Standard Deviation.
Plugging those into the online plotter…
μ = 61.88407
σ = 2.159154
x = 60.5
The online plotter gives me a result of P(X < x) = P26
This is far enough from the P27 I arrived at by linear interpolation, to warrant a more accurate approach.
I searched around a bit and stumbled across a great explanation of z-Scores.
Z-Score is the number of standard deviation from the mean that a certain data point is.
(x - M) / SD = -0.651
Then I was able to convert that into a percentile by consulting a z-score table.
Looking up -0.6 on the left side vertically and then 0.05 horizontally I get to 0.25785
So that rounds to be also P26.
So that’s one workable approach, although it would require me to implement these z-Tables so that I can implement it in an app. I found a Swift package that offers multiple statistics functions.
The function for „Normal distribution“ is described as
Returns the normal distribution for the given values of x, μ and σ. The returned value is the area under the normal curve to the left of the value x.
I tried it out for the second example, to see what result I would get for this value between P25 and P50:
let y = Sigma.normalDistribution(x: 60, μ: 55.749061, σ: 2.00422)
// result 0.2607534748851712
That seems very close enough to P26. It is different than the value from the z-tables, 0.25785
but it rounds to the same integer percentile.
For the first example, between P97 and P99, we also get within rounding distance of P98.
let y = Sigma.normalDistribution(x: 60, μ: 55.749061, σ: 2.00422)
// result 0.9830388548349042