4

We are doing a bit of coordinated house cleaning over at Cognitive Science in order to get our %Answered metric up to greener pastures. Since we have a few thousand questions and a daily stream of new questions, it can be hard to get a feel for how we are doing on a day to day basis, however. The %Answer metric is reported as a rounded full percentage, so it just doesn't really convey precise enough information for us to tell.

SE is ultimately built up around community-based behavioral reinforcements and punishments, and I think decimals for %Answered would make it easier for older Beta site communities with many questions to track their progress.

Could the %Answered metric on Beta sites and Area 51 be changed to show one or two decimals?

9

I think those statistics are really meant more as a lightweight "here's an idea of where you are" kind of deal. They aren't really supposed to be 100% accurate, 100% of the time, and as such, showing several decimal places would be misleading at best.

If we show people that 80.65% of their ten thousand questions are answered, and they answer one, they'll expect to see that number go up immediately, just because it's so "accurate," and they'll be confused when it doesn't.

A better solution, in my eyes at least, is just to use an SEDE query to find your percentage. Note, of course, that this is cached, and is only accurate to the previous Monday. But it gives you a better idea of what the data actually is, and it's unlikely to confuse the majority of users, who are just looking for an estimation of how likely their question is to get answered, or how many questions there are that don't have answers yet.

Here's a copy of the SEDE query I just linked to, perhaps someone else would like to improve it:

WITH Answered AS (
  SELECT DISTINCT ParentId AS Id
  FROM Posts
  WHERE PostTypeId = 2
),
Counts AS (
  SELECT SUM(IIF(A.Id IS NULL, 0, 1)) AS Answered, COUNT(*) AS Asked
  FROM Posts Q
    LEFT OUTER JOIN Answered A ON Q.Id = A.Id
  WHERE Q.PostTypeId = 1
)

SELECT *, Answered / CAST(Asked AS FLOAT)
FROM Counts
  • Thanks so much for writing that query! I don't think anyone would be confused by one decimal, but I admittedly have no idea how accurate the data really is. I guess what I'm also saying is it would be nice if it WAS accurate enough to allow me to tell day by day changes (and no more accurate than that), but I see your point as well. – Christian Hummeluhr Apr 23 '15 at 9:11
  • 3
    @ChristianHummeluhr confusion may not be the right word, but they will complain. There are values that get cached all of the the place in Stack Exchange, and there are frequently meta questions asking why that number didn't increase when they did an action, – psubsee2003 Apr 23 '15 at 9:27
  • @psubsee2003 No good idea survives contact with users. :[ – Christian Hummeluhr Apr 23 '15 at 9:29
2

Matthew Haugen's answer presented a good approximation, showing the percentage of questions with at least one answer. However, Emmet (former SE dev) posted in Do the statistics show on Area 51 include also the closed questions? (thanks to fedorqui for pointing this out):

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

Then,

%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

Result:

%Answered *Results for Jan. 8, 2017 at 6:55

Where Answered = AcceptedNotClosed + PositiveScoreNotAcceptedNotClosed + Closed.
And then %Answered = 100 * Answered / Asked.

You must log in to answer this question.

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