Template talk:COVID-19 pandemic data/Per capita

Table alignment on page edit

Why does the table hang to the right side of the page? I'm genuinely curious, looked at the markup and couldn't figure it out. Please help! Thank you! Kvwiki1234 (talk) 07:06, 8 June 2020 (UTC)Reply

Kvwiki1234, I think it's likely coded in the class or div-ID, both of which I copied from the non-per capital table. {{u|Sdkb}}talk 13:12, 8 June 2020 (UTC)Reply

We're close to having this work properly edit

  You are invited to join the discussion at Wikipedia:Village_pump_(technical)#Running_up_against_technical_limits_with_Template:COVID-19_pandemic_data/Per_capita. {{u|Sdkb}}talk 00:07, 9 June 2020 (UTC)Reply

Still problems... edit

Several of the figures are still wildly inaccurate. For instance, the table reports 20,000 cases per million in Panama (the actual figure is about 4,000) and shows Spain with over 1,000 deaths per million (actually around 600). On the other hand, the table reorts Mauritania with 2 cases per million (it should be around 160) Grutness...wha? 13:31, 11 June 2020 (UTC)Reply

Grutness, the issue with Panama is because the most recent change to the Wikidata item population count was to enter the 1950 population count. We need to change the mechanism so that it uses the most recent count in terms of year, not most recent in terms of most recent entered value.
For Spain, it looks like the Wikidata item hasn't been updated since May and has a death count double what's in the actual tweet used as a source. Not sure why that is.
For Mauritania, it looks like it only had 9 cases when the item was last updated in May. {{u|Sdkb}}talk 01:46, 12 June 2020 (UTC)Reply

Faroe Islands is showing as having more cases than inhabitants edit

Well done for this template, it is very close to working! I just noticed that the template marks Faeroe Islands as having 3 million cases per million inhabitant, which is funny. Probably the table points to the wrong Faeroe Islands Wikidata entry for population. Please also check San Marino and Finland, which seems to have numbers that are very off. Courage for the last modifications and make the table current! Raphaël Dunant (talk) 13:15, 12 June 2020 (UTC)Reply

Naypta, it looks like the Faeroe Islands thing just popped up with the most recent update. Any idea what's going on? {{u|Sdkb}}talk 17:17, 12 June 2020 (UTC)Reply
@Sdkb and Raphaël Dunant: Hey, thanks for the feedback! This is actually working as intended. The population of the Faroe Islands is very small - only 52,154 - so a per million measurement is always going to seem way out. In this case, it's doing 184 cases divided by that figure, and then multiplying out for a million. It may have changed recently as I changed the bot to make sure it understood preferred Wikidata claims - see wikidata:Q87906931#P1603 and wikidata:Q4628#P1082. Naypta ☺ | ✉ talk page | 17:23, 12 June 2020 (UTC)Reply
Ah... no. Ignore that. 3 million per million... yeah that's a problem. I think it's an order of magnitude out... I copied over the multiplication factor from the previous version of this template, but evidently didn't check it well enough! Fixing. Naypta ☺ | ✉ talk page | 17:37, 12 June 2020 (UTC)Reply
  Fixed What had actually happened wasn't anything to do with that, but rather that the preferred claim had a point as a place value separator rather than as a decimal separator, but Wikidata interpreted it as a decimal point. Fixed the entry on Wikidata, and the bot's rerunning now to match. Naypta ☺ | ✉ talk page | 17:46, 12 June 2020 (UTC)Reply

List of countries whose cases per capita is noticeably incorrect edit

Thanks again for the nice work. Here is the full list of countries where there is a factor of at least two between the real value and the table value, and where the number of cases is greater than 100:

Sortable table
Country Actual value Table value Error factor
San Marino 20671 4521 4.57
Singapore 7048 7 1006.9
Belarus 5579 2746 2.0
Moldova 4137 12 344.8
United Arab Emirates 4196 1 4196.0
Djibouti 4118 1312 3.1
Sao Tome and Principe 3221 20 161.1
France 2330 278 8.4
North Macedonia 1782 807 2.2
Gabon 1594 1 1594.0
Finland 1282 0 inf.
Cape Verde 1266 209 6.1
South Africa 1054 173 6.1
Equatorial Guinea 962 66 14.6
Guinea-Bissau 910 441 2.1
Iraq 454 6 75.5
Eswatini 432 135 3.2
Donetsk Peoples Republic 426 90 4.7
Egypt 412 118 3.5
Central African Republic 372 31 12.0
Guinea 362 181 2.0
Cameroon 327 112 2.9
Suriname 322 160 2.0
Senegal 299 126 2.4
Slovakia 283 19 14.9
Malaysia 258 1 258.0
Philippines 234 1 234.0
Somalia 228 106 2.2
Lebanon 208 50 4.2
Ivory Coast 181 7 25.9
Nepal 171 0 inf.
Sudan 162 48 3.4
Abkhazia 147 16 9.2
Sierra Leone 140 45 3.1
Congo 139 39 3.6
Somaliland 137 0 inf.
South Sudan 131 15 8.7
Liberia 94 21 4.5
Mali 88 39 2.3
Sri Lanka 86 0 inf.
Zambia 84 26 3.2
Nigeria 74 25 3.0
Togo 70 26 2.7
Kenya 69 15 4.6
Libya 60 10 6.0
Chad 54 23 2.3
DR Congo 53 5 10.6
Madagascar 48 7 6.9
Ethiopia 30 2 15.0
Malawi 25 3 8.3
Zimbabwe 23 2 11.5
Mozambique 17 4 4.3
Uganda 17 3 5.7
Syria 9 0 inf.
Cambodia 8 0 inf.
Angola 4 2 2.0
Vietnam 3 0 inf.

I hope this list will help make the table more correct and usable as a source of data for This map. Raphaël Dunant (talk) 13:31, 13 June 2020 (UTC)Reply

@Raphaël Dunant: Hey, thanks for your work here. How are you calculating this data? Taking, for example, the DRC from this list: my bot takes wikidata:Q87706558#P1603's latest figure, 471, and then divides that by the population at wikidata:Q974#P1082, 86790567. The template then takes that figure and multiplies up by a factor of a million to get the rate per million - which, indeed, is 5.42. Your table says it ought to be 53 - which is obviously quite a significant difference. How are you generating that? Naypta ☺ | ✉ talk page | 13:37, 13 June 2020 (UTC)Reply
The main sources of data for this comparison are Template:COVID-19 pandemic data and List of countries and dependencies by population. For DR. Congo, the official number of infections is 4724 (source). Best. Raphaël Dunant (talk) 14:12, 13 June 2020 (UTC)Reply
@Raphaël Dunant: Thanks, I've updated that specific one, but clearly other Wikidata entries are also out of date if the problem is of this scale. Might you and/or Sdkb be able to help me out in updating them with the relevant data? Cheers! Naypta ☺ | ✉ talk page | 14:33, 13 June 2020 (UTC)Reply
@Naypta and Raphaël Dunant:, I saw at some point while I was digging through Wikidata that someone mentioned that Johns Hopkins releases their data in a way that makes it importable to Wikidata, and there was interest in setting it up to do so. I think the more durable solution (as opposed to patchwork fix) is to nudge them to get that up and running. I mean, this is the number one data-related thing happening in the world right now, so they really ought to get their act together and give us more up-to-date figures to work with. {{u|Sdkb}}talk 17:38, 13 June 2020 (UTC)Reply
@Sdkb: If you're aware of where that discussion is, it'd be great to see it - happy to help with the technical heavy lifting for that if I can. Naypta ☺ | ✉ talk page | 17:52, 13 June 2020 (UTC)Reply
Naypta, found it: wikidata:Wikidata:Requests for permissions/Bot/CovidDatahubBot. Looks like it's in progress. {{u|Sdkb}}talk 18:00, 13 June 2020 (UTC)Reply
@Sdkb: Brilliant, cheers! I've dropped a message over there just notifying the folks involved that we're interested in it, and offering my help if there's anything I can help with. Naypta ☺ | ✉ talk page | 20:06, 13 June 2020 (UTC)Reply
@Sdkb:@Naypta:@Raphaël Dunant: Great that you found the bot proposal! It had gotten behind in the priorities ranking for me, but this nudge has made it go quite a few positions up. It has been hard to assemble all the people and asynchronously clean up the way Wikimedia handles this data. Genuinely hard, I've been 3 months deep in trying to do it. I was wondering, would an event maybe help? Like a Wikimedia COVID-19 Case Data Conference/Hackathon/Edit-a-thon ? TiagoLubiana (talk) 00:57, 15 June 2020 (UTC)Reply

Remaining bugs/to do item edit

For bugs, it looks like South Ossetia isn't generating any data, and the United States isn't generating references. For a to-do item, we should copy over the notes from the main template specifying things like, for Northern Cyprus, Cases from this de facto state are not counted by Cyprus. I hate the fork that that creates (it would be much better if the per capita and non-per capita tables were built off of the same core), but I don't see any easy way to avoid it. {{u|Sdkb}}talk 00:46, 15 June 2020 (UTC)Reply

@Sdkb: US issue fixed - the name in the template for the US references was wrong. South Ossetia has no data available on Wikidata, so some needs to be sourced for it. As to copying notes across, are we sure that those notes still apply, given that the sources on Wikidata may be different to the sources on the main template? Naypta ☺ | ✉ talk page | 08:37, 15 June 2020 (UTC)Reply
Looks good; thanks for fixing the Wikidata South Ossetia gap! And that's a good question — I'm not sure how Wikidata handles that. (For Northern Cyprus, it looks like there's a "geoshape" value that defines the border.) Oh, and one other thing we should probably do: get the table to default sort by cases, rather than alphabetically. {{u|Sdkb}}talk 00:16, 16 June 2020 (UTC)Reply