Hello statisticians,
I want to create 2 macros that takes the value of the 5th from lowest value of pred_val and 5th from the highest of the pred_val.
I tried to rank it but rank would'nt hep as some values in pred_val are equal or not unique.
I tried levelsof , matrow(x) but it would only help with lowest 5, not the highest one.
can you please help?
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float pred_val .00057271216 .00057271216 .00057730306 .0005819307 .0005819307 .0005819307 .0005819307 .0005819307 .0005819307 .0005819307 .000585738 .000585738 .000585738 .000585738 .000585738 .000585738 .0005865954 .0005865954 .0005865954 .0005865954 .0005865954 .0005865954 .0005865954 .0005865954 .0005865954 .0005865954 .0005865954 .0005865954 .0005865954 .0005865954 .0005865954 .0005904333 .0005904333 .0005904333 .0005904333 .0005904333 .0005904333 .0005904333 .0005904333 .0005904333 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .0005912975 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .000595166 .0005960373 .0005960373 .0005960373 .0005960373 .0005960373 .0005960373 end sort pred_val levelsof pred_val in 1/800, matrow(low5) mat li low5 local low5=low5[5,1] di `low5' ***How to do this for the highest one?
I want to create 2 macros that takes the value of the 5th from lowest value of pred_val and 5th from the highest of the pred_val.
I tried to rank it but rank would'nt hep as some values in pred_val are equal or not unique.
I tried levelsof , matrow(x) but it would only help with lowest 5, not the highest one.
can you please help?
Comment