I'm analyzing a sample of GPs. I want to describe the GP's with extreme values of a variable. This means the subgroups were the variable is above P90 and below P10. I want to bootstrap the entire sample and use the bootstrapped p90 and p10 results as the definitions of the groups above p90 and below p10. Next I want to know the mean and confidence intervals for the mean for these two groups. How can this be done in stata?

I am able to use: bootstrap r(p90), rep(1000): summarize var, detail

However, this only gives the P90 value. I also want to know the bootstrapped mean and CI for the group above p90 :-) I hope this is possible?