# How to rank observations with two variables (website performance)

I have no background in statistics, so I find myself confused by this simple problem. I'm not even sure which search terms to use.

I have some website performance data. I have the number of times a page was requested/visited, and how long it took to load (average time and percentiles in seconds).

I want to identify pages that are often requested/visited but take a long time to load. So for example, if an "FAQ" page takes 30 seconds to load but is only visited a few times a day, this is less important than a "Search" page that takes 2 seconds to load but is used thousands of times a day. The purpose is to make a "Top 10" list or something like that which some website developers will use to improve performance.

I had thought to do something simple like create a new column with NUM_TRANSACTIONS * AVERAGE and sort that, but I'm wondering if there is something wrong with this approach.

SOLVED: Edgar's answer worked well for me. I created the plot he suggested, and the scoring mechanism, and they produced similar results. The number markers indicate ranking.

• Log scale often helps on such graphs. – Nick Cox Apr 24 at 20:41
• On log scale lines with $xy$ constant are straight too. – Nick Cox Apr 24 at 21:24
• Thanks for the tip, @NickCox, it is easier to read now. I don't understand your second comment though. Are you suggesting another improvement? – DavidS Apr 24 at 21:30
• You are interested in the product $xy$ of your two variables. On log scale hyperbolas $xy =$ constant are mapped to straight lines $\log x + \log y =$ another constant. I find straight lines easier to compare than hyperbolas. Also, log scale will spread your data more evenly. – Nick Cox Apr 24 at 21:36
• Thanks for explaining, @NickCox. It's a big help. – DavidS Apr 25 at 17:10

NUM_TRANSACTIONS * AVERAGE is the total time spent loading this page (e.g. page 1: the sum of all 891 343 loading times of this page), since AVERAGE = TOTALTIME/NUM_TRANSACTIONS. This is not a good measure for your problem, since you lose the information which pages are requested frequently.

For the start, it might be helpful to plot the NUM_TRANSACTIONS versus the AVERAGE time to load (since we don't know anything else about the pages like number of images/javascript code/whatever) and inspect visually if there are unusually high AVERAGE loading times associated with high NUM_TRANSACTIONS.

Alternatively, if you want to identify the Top 10 problematic candidates, you could find the overall average loading time: TOTALAVERAGE = (sum of all (NUM_TRANSACTIONS*AVERAGE))/(sum of all NUM_TRANSACTIONS), then sort your pages by decreasing NUM_TRANSACTIONS and take the 10 topmost pages where AVERAGE is above TOTALAVERAGE.

Bulding on this, you could calculate a rough SCORE = NUM_TRANSACTIONS*(AVERAGE-TOTALAVERAGE) for all pages and take the Top 10 with the highest positive SCORE.

• Thank you Edgar. Your first paragraph shows exactly the sort of bone-headed mistake I was trying to avoid. I'm going to try both of the approaches you suggest. My goal is to make something like a "Top 10" list. (I will mark a question correct this afternoon.) – DavidS Apr 24 at 16:12
• I edited my answer, adding a very rough score that might help you associating number of transactions and higher-than-average loading times. – Edgar Apr 24 at 16:20
• Just checking, but I think you must mean TOTALAVERAGE = (sum of all (NUM_TRANSACTIONS*AVERAGE))/(sum of all NUM_TRANSACTIONS)? – DavidS Apr 24 at 18:49
• yes, that's correct :) – Edgar Apr 25 at 8:22
• If you have a moment for a mini-question: is this just "basic stats"? I feel like I just stumbled upon a big blank spot in my education and I'd like to fill it with something, but I'm not sure what the topic is -- "stats" seems too broad. – DavidS May 8 at 22:40