Situation (example only):
I have 10 steps that each have a start and end time, the steps occur in order. I'll refer to the steps as steps 1 through 10.
I have between 1 and infinite (inclusive) records that each contain exactly 1 copy of each step.
I want to calculate what % of the total time is taken on any given step (on average), with the total time being calculated from the average of the difference between the start of step 1 and the end of step 10.
When I try to do this currently, I get obviously incorrect results, such as steps taking >100% of the time and the total % values adding up to >100% even when all individual values are <100%. The values appear to show generally the sort of ratio that I might expect however.
Example (all durations in milliseconds):
step 1 start 8:30:00.000
step 3 duration 1200
step 10 end 8:30:47.230
step 1 start 8:31:12.455
step 3 duration 2200
step 10 end 8:31:20.000
step 1 start 8:33:02.213
step 3 duration 500
step 10 end 8:33:30.100
step 1 start 8:28:30.670
step 3 duration 3800
step 10 end 8:28:45.002
step 1 start 8:38:17.345
step 3 duration 9000
step 10 end 8:38:56.690
We can see that the total duration based off step 10 end - step 1 start is as follows:
The average of which is
The average of times at step 3 is
If I were to have data for each of the other steps and get the average of the data as I have shown for step 3 here, and then calculated the % of the total that is represented by each step, the result would be incorrect.
Things I have tried:
I have tried adding up all values for each step in each record and using that instead of the difference between step 1 start and step 10 end, although this had similar results unsurprisingly.
I have also tried adding up the averages of each step together and using that, however, having read about why the average of an average is usually incorrect, I can see why this would not work. I also suspect this is the reason what I am attempting doesn't work currently.
What do I have to do to get the results I am after? That is the % of the average total time taken by a step on average. Can I even realistically do what I'm asking or am I barking up the wrong tree here?
Apologies if I have asked this question in a roundabout way or forgotten something specific to the maths stack exchange as this is my first post here and I'm no mathematician. Feel free to add tags to the post as I'm not sure what this should be tagged as.