## quantiles: list first number, last number, and numbers in-between

Post your working scripts, libraries and tools
jeeswg
Posts: 4963
Joined: 19 Dec 2016, 01:58
Location: UK

### quantiles: list first number, last number, and numbers in-between

- I needed to do some quality testing. I wanted to test the first item, the last item, and an even spread of numbers of in-between, so I created the function below.
- If there are any similar scripts it would be interesting to know. Thanks.

- Note: If you split a range by n-tiles, you get n segments, n-1 values within the range, and n+1 values including the start/end of the range.
- E.g. if you split the range 0-100 into quartiles (4-tiles), you get 4 segments, 3 values with then range (25, 50, 75), and 5 values including the start/end of the range (0, 25, 50, 75, 100).
Helgef
Posts: 3151
Joined: 17 Jul 2016, 01:02
Contact:

### Re: quantiles: list first number, last number, and numbers in-between

- If there are any similar scripts it would be interesting to know.

The same, although, mine is more efficient.

Cheers.
jeeswg
Posts: 4963
Joined: 19 Dec 2016, 01:58
Location: UK

### Re: quantiles: list first number, last number, and numbers in-between

- Interesting, calculate the ratio first, rather than the difference. Plus use SetCapacity.
- Yes, the function is basically 'for i = a to b (step c)', but instead of the step size, you specify the step count, I hadn't really noticed that, I was coming at it from a different angle (trying to find equidistant points, thinking that is was different from quantiles, then thinking it was the same).
- Have you seen any languages that allow you to use step count instead of step size?
- You know, I recently read your description of the function and I didn't realise its significance.
- Do you use it a lot? Cheers.