So, there is an initial DF. The first column shows the stage, full cycle 1-5. If suddenly there is not a full cycle in the sample, then all observations of the incomplete cycle are deleted. That is, the input is:
Time X1 X2 1 5 5 2 6 6 3 4 4 4 6 5 5 5 5 1 5 6 2 6 5 3 5 6 1 4 6 2 6 5 3 5 5 4 6 5 5 5 5
The second cycle is incomplete: 1-3, so all their observations are deleted. And the output is:
Time X1 X2 1 5 5 2 6 6 3 4 4 4 6 5 5 5 5 1 4 6 2 6 5 3 5 5 4 6 5 5 5 5