# On average of percents

I have read some pages about how to calculate the average of percents. However, still I don't understand something...

Assume data points are organized in the following manner: We have two categories and each category contains some malware files. We run a virus detection program to see how many files are detected as malware. So, for SET1, there are 30 files and we have detected 25 viruses. The coverage is then 83.3%. The same is true for SET2.

          items         detected          percent
set1      30              25              83.3%
set2      80              40              50%


Now, we want to know what is the average coverage for this program. We have two methods:

1- We can say, there are totally 110 files (30+80) and totally 65 files (25+40) are detected. So, the average coverage is 65*100/110 which is 66.6%

2- We can calculate (83.3+50)/2 which is 59%.

Which one is more meaningful?

• Related question and answer: stats.stackexchange.com/a/144067/168251 – afagarap Dec 28 '18 at 9:11
• That is talking about measurements in time. However, mine is not related to time. So, I think that is not applicable here. – mahmood Dec 28 '18 at 9:16
• You could average it as how you would regularly do it, unless the percentages are weighted. – afagarap Dec 28 '18 at 9:18
• Both are equally "correct," depending on what this average is intended to estimate. Please edit your post to clarify what the purpose of your analysis might be. – whuber Dec 28 '18 at 16:03
• @whuber: I have edited the post with more details. – mahmood Dec 31 '18 at 12:34

You can caluclate it like this: (30 * 83.3% + 80 * 50%)/110 = 59%
• But (83.3+50)/2 is not weighted as far as I could understand. Both numbers are normalized to 100. – mahmood Dec 28 '18 at 9:57