how to calculate percentage of a sample?