Hello, I am trying to create the mean of a specific variable based on the for each 10% percentile of another. The complication is that the data are frequencies so that each observation refers to one or more observations. Below is an example of the data.
Specifically, I would like to first order "success_rate" from smallest to largest and then for each decile of the "frequency" data, create an average of "success_rate".
Thank you!!
Specifically, I would like to first order "success_rate" from smallest to largest and then for each decile of the "frequency" data, create an average of "success_rate".
Thank you!!
| frequency | success_rate |
| 50 | 0.3523399 |
| 50 | 0.0508585 |
| 50 | 0.2308863 |
| 58 | 0.2329031 |
| 62 | 0.0651608 |
| 64 | 0.3329133 |
| 64 | 0.0353564 |
| 65 | 0.0671273 |
| 65 | 0.1377679 |
| 66 | 0.1189656 |
| 70 | 0.0730684 |
| 71 | 0.0672357 |
| 73 | 0.095927 |
| 77 | 0.115903 |
| 77 | 0.2428701 |
| 81 | 0.332109 |
| 83 | 0.2538869 |
| 84 | 0.0639709 |
| 85 | 0.1152154 |
| 85 | 0.1305838 |
| 87 | 0.0424351 |
| 90 | 0.2949313 |
| 91 | 0.3132716 |
| 91 | 0.3804671 |
| 91 | 0.1309527 |
| 92 | 0.3211307 |
| 93 | 0.059292 |
| 93 | 0.062638 |

Comment