Hi, appreciate your help on this. I had obtained the summary statistic of gross_bill, with the percentiles (p1, p5, p10, p25, p50, p75, p90, p95, p99) result. What I would like is the corresponding average LOS (length of stay) for these percentiles. So, if row 1 to row 3 is in the 1st percentile, the average LOS would be (5+4+2)/3 = 3.6. How can I code this up?
+------------------+
gross_bill los
-----------------
1. 5906.141 5
2. 6579.505 4
3. 6732.888 2
4. 7953.42 6
5. 8166.664 6
-----------------
6. 8199.374 6
7. 8284.317 6
8. 8317.767 7
9. 8342.141 5
10. 8426.037 7
+-----------------+
many thanks!
+------------------+
gross_bill los
-----------------
1. 5906.141 5
2. 6579.505 4
3. 6732.888 2
4. 7953.42 6
5. 8166.664 6
-----------------
6. 8199.374 6
7. 8284.317 6
8. 8317.767 7
9. 8342.141 5
10. 8426.037 7
+-----------------+
many thanks!
Comment