TL;DR

The % answered shown in Area51 statistics does not match the real value for answered questions.

Related questions

Context

We are evaluating different strategies on Stack Overflow en español regarding close reasons, comments before closing, quality vs. quantity and new users captation.

We are relying on a data-informed approach. However, our statistics don't match. I understand that these metrics serve only as a broad guideline to the site health, but I reckon we should get our numbers straight.

Trying to infer how Area51 considers a question as answered

Given there is no official documentation on how % answered is being calculated, and the fact that we have tested hundreds of SEDE queries over the last month, I tried to infer it considering:

  • Regular and closed questions.
  • Total answers and answers with a positive overall score.
  • Filtering out questions asked 1 and even 2 weeks ago.
  • Questions with more than 1 answer.
  • SEDE update time (all comparisons were made against the value shown around this time over the last 4 updates).
  • Minor differences that could be the result of different update schedules.

Results

The following SEDE query shows some of the statistics we used: http://data.stackexchange.com/es/query/530265/percentage-answered.

And these screenshots were taken from Area51 statistics for Stack Overflow en español around last SEDE update time:

40.6 questions per day 72% answered 216 avid users & 10599 total users 1.9 answer ratio 5388 visits/day

Comparison with 2 other sites:

I am including Hardware Recommendations and Monero statistics for reference (both in public beta as well).

            %Answered  \  Site              SOes      HR     monero  
 ---------------------------------------- -------- -------- -------- 
  Total                                    83.36%   67.48%   97.23%  
  Accepted OR Answer Score > 0             70.09%   63.43%   96.68%  
  Total (except closed)                    84.48%   68.08%   98.55%  
  Accepted OR Answer > 0 (except closed)   70.94%   63.95%   97.97%  
 ---------------------------------------- -------- -------- -------- 
  Area51                                   72%      68%      99%    

Source: SEDE (SOes, hardwarerecs, monero), Area51 (SOes, hardwarerecs, monero)

As you can see, the value shown by Area51 does not match any of the queries we have tried. And these differences would seem to be larger than what could be interpreted from different update schedules (SEDE vs. Area51).

Question

Can you explain how % Answered is being calculated and check if there is something wrong in the value shown in Area51 statistics?

share
up vote 7 down vote accepted

Five months later, fedorqui pointed me in the right direction.

Emmet (former SE dev) posted an answer in 2011 that explains it: Do the statistics show on Area 51 include also the closed questions?

answeredPercentage ("% answered" on the stats page) is actually "percentage of questions that have been resolved" ...either by an answer or by closing.


Therefore,

%Answered = (Accepted + Answer_Has_Positive_Score + Closed) / TotalQuestions


And this is the SEDE query to get the %Answered shown in Site Health Statistics:

Code:

WITH Answers AS (
  -- unique answers with best score per question
  SELECT ParentId AS Id, MAX(Score) AS Score
  FROM Posts
  WHERE PostTypeId = 2
  GROUP BY ParentId
)
, Counts AS (
  SELECT
    -- Count for questions joined with answers
    COUNT(*) AS Asked,
    SUM(IIF(Q.AcceptedAnswerId IS NOT NULL AND Q.ClosedDate IS NULL, 1, 0)) AS AcceptedNotClosed,
    SUM(IIF(Q.AcceptedAnswerId IS NULL AND A.Score > 0 AND Q.ClosedDate IS NULL, 1, 0))
      AS PositiveScoreNotAcceptedNotClosed,
    SUM(IIF(Q.ClosedDate IS NULL, 0, 1)) AS Closed
  FROM Posts Q
  LEFT OUTER JOIN Answers A
    ON Q.Id = A.Id
  WHERE Q.PostTypeId = 1
)

SELECT 
  Asked, AcceptedNotClosed, PositiveScoreNotAcceptedNotClosed, Closed,
  (AcceptedNotClosed + PositiveScoreNotAcceptedNotClosed + Closed) AS Answered,

  Cast(Cast(
    (AcceptedNotClosed + PositiveScoreNotAcceptedNotClosed + Closed)
    / CAST(Asked AS FLOAT)
    *100 as decimal(18,2)
  ) as varchar(5)) + ' %' AS "%Answered"
FROM Counts
share

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .