ICTatRTI / coconut-analytics

Browserified & backboned version of coconut-reports
Other
2 stars 3 forks source link

Graphs: Questions about axis scaling and labeling #282

Closed gmcressman closed 7 years ago

gmcressman commented 7 years ago

In both graphs below we see number of (positive) cases.

  1. Why do we say "Positive" in one title and not in the other? Don't both graphs show positive cases?
  2. These data are for the same time period. The number of <5 cases is very small. Why is the Y-axis scaling of the two graphs of entirely different magnitudes? Why are the numbers of cases about the same across the two graphs, since the graph to the right is simply disaggregated by age group?
  3. Why, since these are over the same time period, is the X-axis scaling so different? ".005" weeks on the left - what could that mean?

image

scloo commented 7 years ago

I don't know the answers to Q1 and 2. Perhaps Mike can answer that better. As for Q3, the first graph is by week number while the second graph is by date. We tell dc.js that the data is week# and the X units is in weeks, that's where we get the weeks. Whereas the second chart, the data presented to dc.js is by dates, and the chart is of type time.scale, dc.js automatically sets the x-units depending on the range of date in the data.

As for the ".005" unit, I do not know why dc.js puts it that way sometimes. Normally it should be "5" instead of ".005". Not sure if that is a bug in dc.js.

mikeymckay commented 7 years ago

I think the short answer is that the graph on the left is broken.

On Wed, Dec 14, 2016 at 8:14 AM, Steve Loo notifications@github.com wrote:

I don't know the answers to Q1 and 2. Perhaps Mike can answer that better. As for Q3, the first graph is by week number while the second graph is by date. We tell dc.js that the data is week# and the X units is in weeks, that's where we get the weeks. Whereas the second chart, the data presented to dc.js is by dates, and the chart is of type time.scale, dc.js automatically sets the x-units depending on the range of date in the data.

As for the ".005" unit, I do not know why dc.js puts it that way sometimes. Normally it should be "5" instead of ".005". Not sure if that is a bug in dc.js.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/ICTatRTI/coconut-analytics/issues/282#issuecomment-267076966, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAu75GKn2sgcyJ-XNmkHgnAA-QyP-7Fks5rIBXugaJpZM4K0UaB .

scloo commented 7 years ago

Mike, what is the difference between "Number Positive Cases Including Index" and "Number Positive Cases At Index Household" ? I thought they are the same but they have different values in one of the records I was looking at.

scloo commented 7 years ago

Have made some modification to correct the data extracted for the Incidence graph. And also made improvement to performance for the graphs overall. @mikeymckay I have also made an addition too the caseCounter view file. I added the following line: emit [doc["Index Case Diagnosis Date"], "Number Positive Cases Including Index"], doc["Number Positive Cases Including Index"]

And I'm using this "Number Positive Cases Including Index" to graph Incidence graph.

mikeymckay commented 7 years ago

Number Positive Cases Including Index - includes every positive malaria case found by the system, including the ones found at health clinics and the ones found by malaria surveillance officers at households and any where else they might have tested

Number Positive Cases At Index Household - only counts the number of cases found by malaria surveillance officers found at the households of index cases

Mike

On Thu, Dec 15, 2016 at 6:59 AM, Steve Loo notifications@github.com wrote:

Mike, what is the difference between "Number Positive Cases Including Index" and "Number Positive Cases At Index Household" ? I thought they are the same but they have different values in one of the records I was looking at.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/ICTatRTI/coconut-analytics/issues/282#issuecomment-267348205, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAu732Z0EYY3_4Dcz4v_1qluiKT_2fpks5rIVXqgaJpZM4K0UaB .

mikeymckay commented 7 years ago

Ok that's fine. It could also have been calculated by adding Over 5 and Under 5 together, but it is a bit easier this way I guess.

On Thu, Dec 15, 2016 at 10:54 AM, Steve Loo notifications@github.com wrote:

Have made some modification to correct the data extracted for the Incidence graph. And also made improvement to performance for the graphs overall. @mikeymckay https://github.com/mikeymckay I have also made an addition too the caseCounter view file. I added the following line: emit [doc["Index Case Diagnosis Date"], "Number Positive Cases Including Index"], doc["Number Positive Cases Including Index"]

And I'm using this "Number Positive Cases Including Index" to graph Incidence graph.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ICTatRTI/coconut-analytics/issues/282#issuecomment-267409878, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAu7yxEhAH3FgVAO9SaWTCvh250i66dks5rIY0DgaJpZM4K0UaB .

gmcressman commented 7 years ago

I still have questions about the scaling of these two graphs. Let's look at them together.

gmcressman commented 7 years ago

I need to check on this one.

gmcressman commented 7 years ago

@scloo - This still doesn't look correct to me. I cannot understand why the numbers on these two graphs are so different.

gmcressman commented 7 years ago

@scloo - this is the issue we just discussed.

scloo commented 7 years ago

I looked into the detail figures, the 'Current vs Last Year' graph is plotted by week where the other graph is plotted by days/date. So if we take one point in the former graph and then add up all the points in the latter chart which corresponding dates within the week#, we will get a bigger number than what is shown currently. Eg Choose week# 31 in the "Current vs Last Year" chart. It will give the number of cases. Then total up all the points in the "Positive Cases by Age Group" that falls within August 1, 2016 and Aug 7, 2016. That will give the week total.

gmcressman commented 7 years ago

Thanks @scloo. I wonder whether we could clarify the level of data aggregation. Adding a subtitle to the graph on the right - (Aggregated by Week) - might help.