Talk:List of countries by life expectancy
This article has not yet been rated on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||||||||||||||||||
Please add the quality rating to the {{WikiProject banner shell}} template instead of this project banner. See WP:PIQA for details.
Please add the quality rating to the {{WikiProject banner shell}} template instead of this project banner. See WP:PIQA for details.
Please add the quality rating to the {{WikiProject banner shell}} template instead of this project banner. See WP:PIQA for details.
|
Two Jordan-s
One is at 27 the other is at 89.
- Done This no longer an issue, I assume it's been fixed.Forbes72 (talk) 20:19, 24 January 2012 (UTC)
Two Macaus
3 and 11 — Preceding unsigned comment added by 50.92.38.183 (talk) 07:26, 22 October 2012 (UTC)
VOTE!! - HDI in Infobox#Countries|country infobox/template?
The Human Development Index (HDI) is a standard UN measure/rank of how developed a country is or is not. It is a composite index based on GDP per capita (PPP), literacy, life expectancy, and school enrollment. However, as it is a composite index/rank, some may challenge its usefulness or applicability as information.
Thus, the following question is put to a vote:
Should any, some, or all of the following be included in the Wikipedia Infobox#Countries|country infobox/template:
- (1) Human Development Index (HDI) for applicable countries, with year;
- (2) Rank of country’s HDI;
- (3) Category of country’s HDI (high, medium, or low)?
YES / NO / UNDECIDED/ABSTAIN - vote here
Thanks!
E Pluribus Anthony 01:52, 20 September 2005 (UTC)
Male female age expectancies
The CIA Factbook also includes male and female life expecantcies - this would be interesting to include here.Yzerfontein 16:28, 29 January 2006 (UTC)
I added all of the 2007 data, including the male and female numbers, and I omitted the redundant year column, as all of this year's figures are from 2007. Formatting improvements would be appreciated. Caeculus 07:47, 8 May 2007 (UTC)
Well, Cia factbook got other numbers than this column, have they recently changed it? RGDS Alexmcfire —Preceding unsigned comment added by 62.20.130.17 (talk) 07:51, 21 November 2007 (UTC)
Life Expectancy by United Nations
The United Nations also calculated life expectancy for different countries. The rank and result of UN is slightly differ from CIA The World Factbook. For examples, Japan and Hong Kong is considering the world highest life expectancy ranked by United Nations. But in CIA World Fact Book, Japan is only ranked #7 and Hong Kong ranked #6.
So I am considering whether we should add United Nation figures to the table. Joe3600 12:29, 26 May 2007 (UTC)
Ref. Links:
United Nations Human Development Index - International Life expectancy comparison.
- I don't necessarily think there's any harm in adding an external link to the study, though its life expectancy estimates are old (2004), and it excludes a number of smaller entities such as Andorra, Macau, and San Marino. That's why Japan and Hong Kong appear to be "ranked" higher. Maintaining consistency and using estimates from the Factbook exclusively is probably our best option. Caeculus 07:33, 11 June 2007 (UTC)
- I agree. The data from the CIA world factbook seems more complete and up to date. --Lobizón 19:01, 16 August 2007 (UTC)
The CIA world factbook is not up-to-date. Countries hardly ever change from year-to-year. For example, Australian male life expectancy is now 78.7, CIA is 77.8 while UN is 78.9. If you look at the CIA's history of life expectancy at http://www.indexmundi.com/switzerland/life_expectancy_at_birth.html, you can see this problem. It would be better to have the UN figures above the CIA fact book, but even better would be to incorporate results from www.mortality.org, which is a scholarly collection of these stats that are much more up-to-date then CIA. —Preceding unsigned comment added by 121.127.211.46 (talk) 09:04, 17 February 2009 (UTC)
Kaushnik?
Seem like vandalism or what is Kaushnik. RGDS Alexmcfire
- Done This vandalism doesn't appear on the page anymore.Forbes72 (talk) 20:41, 24 January 2012 (UTC)
what?
this seem compeletely different from the CIA ? how can oman's fly a high jump to 75 years? and how did saudi arabia's get so low to 72 years, dont beleive this! get the cia world factbook on again please. 81.132.142.209 12:19, 21 August 2007 (UTC)
- The CIA Fact Book methodology is unclear and its figures differ from those of European census authorities making its numbers dubious. I'll get the census authority nu,bers for Oman and Saudi Arabia and post it here later (if they're available online). --Polaron | Talk 13:34, 21 August 2007 (UTC)
oman
- 72.5 (1999) [1]
- 74.2 (2005?) [2]
- 75.6 (UN estimate for 2010)
- 74.2 (UN estimate for 2005)
- 74 (2006 estimate by Population Reference Bureau) [3]
- Time series life expectancy (official): [4]
- Compare to CIA estimate of 73.6 for 2007
saudi arabia
- 71 (2000) [5]
- 71.9 (2003) [6]
- 71.6 (UN estimate for 2005)
- 72.8 (UN estimate for 2010)
- 72 (2006 estimate by Population Reference Bureau] [7]
- Compare to CIA estimate of 75.9 for 2007
Wrong
Why do many people source CIA World Factbook if it's unclear? It's more accurate and shows 2007 estimates. People find the previous list more useful and more accurate, so what's the point changing it? we'll have a vote then ok?
- How do you know it's more accurate? How about we compare the CIA, UN, and national census authority figures for the less developed countries and see which agree with each other? --Polaron | Talk 13:42, 23 August 2007 (UTC)
Who want's CIA List?
Who wants the UN List? —The preceding unsigned comment was added by 86.133.207.121 (talk) 12:02, August 23, 2007 (UTC)
This issue seems to have been resolved by including both lists, so voting now is unnecessary. If there's a compelling reason for it, adding/removing/combining lists is still up for discussion of course.Forbes72 (talk) 20:53, 24 January 2012 (UTC)
ok ok
But Polaron, what I think is, you should have just left the CIA list, there was no mistakes or it wasn't harmful to anything, it was just a list by CIA! you should have just left it. —Preceding unsigned comment added by 217.44.152.52 (talk) 19:00, August 28, 2007 (UTC)
Map should be updated since it doesn't reflect the figures appearing in the article
Eliko 19:28, 10 September 2007 (UTC)
UN
Let's add these estimates for 2010 which they are really for. Thank You Muzammil01 18:08, 22 October 2007 (UTC)
- If all you're concerned about is the year, we can put in both the 2005 and 2010 figures so people can see how the value is changing. Or, if you only want one figure, we can put in the UN figure for 2007. The CIA figures can have huge discrepancies with census authority figures in many less developed countries. It's not even clear what life table the CIA uses to get its figures. --Polaron | Talk 19:42, 22 October 2007 (UTC)
Hello
I don't know and I don't understand, why would the estimates of the UN be so low for Saudi and so high in CIA. The United Arab Emirates is ranked so high in many of the UN ests, and lower in the CIA, that's one thing i don't understand. Also Oman, is ranked lower than Saudi by many things, such as infant mortality, from the CIA, but ranks better in the UN. What's more developed, OMAN OR SAUDI ARABIA? the infant mortality rate for Saudi, by the CIA est is 12.41 (per 1000) but the UN estimates say 18.8 (per 1000). And Oman is 18 (per 1000) by the CIA and 12 (per 1000) by the UN, is there some opposite stuff going on here on what?
There is a new HDI list coming soon, do you think Saudi Arabia's HDI is going to go higher than 0.777 (which is for 2004) or lower than 0.777, compared to it's rankings. Saudi Arabia seems to me it remains quite poor to the UN and quite more richer to the CIA World Factbook. I do believe you in a way Polaron, but what if Saudi Arabia's Life expectancy is 75.9 and not 72.8. The UN have calculated life expectancies for 2050, how can you measure them until 2050 (it is quite hard though), what if there is a huge change in a some country, and it's life expectancy has rised quite high, Then how would the UN count that in. You can't just estimate life expectancies for the next 43 years. That's why I like the CIA, it has a new list for every year coming, not like the UN who calculate life expectancies for the next couple of decades. You just can't do that!!!.
Thank You.
Muzammil01 21:49, 22 October 2007 (UTC)
- Life expectancies are not measured. How do you directly measure the life expectancy a newborn? I don't think there is a test that can tell you that. Life expectancied are calculated from age- and sex-specific number of deaths for a given period of time. These values are then turned into a model life table and you get life expectancies at different ages and the change in these values per year. If you read through the analytical report of the World Population Prospects, it is stated that for Saudi Arabia, the model life table used is the Coale-Demeny west model, which is a generic model derived from the more developed countries (mostly Western Europe). The CIA, on the other hand, seems to be using a linear projection, at least for population figures, which is not necessarily correct. I have not yet checked its numbers for life expectancy. At a minimum, we have no idea how the CIA calculates life expectancies since they do not publish their methodology. Life expectancy is also not directly related to how rich or poor a country is. A high HDI with a low life expectancy is possible if a country has a high GDP per capita for example. --Polaron | Talk 22:20, 22 October 2007 (UTC)
- Also, just adding that the UN recalculates all its figures every year so any new information is included. So the 2005-2010 numbers published next year may be different from this year's estimate if new demographic data that is included in the calculations. --Polaron | Talk 22:28, 22 October 2007 (UTC)
OK
Ok fine I might have meant CALCULATED I'm sorry for using the wrong word. But even the Population Reference Bureau (PRB) say Saudi Arabia's life expectancy is 75, so it's two against one my friend.
Thanks Muzammil01 11:54, 23 October 2007 (UTC)
- Is it only Saudi Arabia you care about? Have you compared the figures for all the other countries, especially the developing countries. Even the CIA figures are a bit off for some EU countries. The UN list is generally better for demographic figures. If you wish, you can put a footnote beside the Saudi Arabia entry indicating the CIA figure. --Polaron | Talk 12:15, 23 October 2007 (UTC)
Hello
We have had this debate before, let's stop now. Thanks. —Preceding unsigned comment added by Muzammil01 (talk • contribs) 11:10, 24 October 2007 (UTC)
Hello
Hello
Well in a way Polaron I do care about Saudi Arabia, but I shouldn't only care of about Saudi, I should care about others too, well I was born in Saudi Arabia but I now live in the United Arab Emirates. I was born in Riyadh (Capital of Saudi) and now I live in Abu Dhabi (Capital of the UAE and the richest city in the world.) lol.
What about you Polaron where do you live?
Muzammil01 17:46, 28 October 2007 (UTC)
Andorra?
As estimated in 2007, Andora now holds the highest life expectancy in the world. Should this be changed? 69.37.97.64 15:20, 11 November 2007 (UTC)
- It does seem rather odd that a sovereign country, member of the United Nations, which ranks highest in the world for life expectancy [8], should strangely be excluded from a list of countries by life expectancy. I can think of no reason whatsoever not to include Andorra. Aridd (talk) 21:03, 8 January 2008 (UTC)
- This particular UN list excludes small countries where the life expectancy is strongly affected by migration rates and is no longer a measure of quality of life. The exceptionally high life expectancy in Andorra is due mainly to the fact that many residents of Andorra return to their original country when they grow old and a significant number of residents die outside Andorra. This results in an anomalously low death rate and high life expectancy. We could possibly include it and a few other small countries that were specifically excluded because of this reason as long as we clarify these entries with a note of indicating that the numbers are not necessarily comparable to other countries. --Polaron | Talk 22:43, 8 January 2008 (UTC)
Well, yeah! It should be changed! Ulysses S Grant (talk) 22:49, 29 April 2008 (UTC) The exceptionally high life expectancy of Andorra and in lesser extent in some small countries due to many factors Firstly Andorra is the small country so the deprived area where people are likely (especially for men) to premature death due to suicide, homicide victims, poor diet are lessened thus the survivor to old age of cohort will be high Secondly most of Andorrans have a good nutrition such as olive oil, fish (imported from France or Spain) and they can access the French or Spain health care system easily. Thirdly Andorra is the country with safe-haven for tax and many Spaniards and French businessmen dwell to Andorra to avoid an income tax and usually die in AndorraCristiano Toàn (talk) 03:24, 1 November 2011 (UTC)
Map
Is it just my computer or is the colour for less than 45 almost exactly the same as the colour for 80+ on the map? 68.145.199.164 (talk) 05:53, 3 January 2008 (UTC)
- It's you. If you look at the hex values, the over 80 one (#002100) is a dark green while the under 45 (#210000) is a very dark brown. Maybe they should be changed. —Vanderdecken∴ ∫ξφ 12:11, 3 January 2008 (UTC)
Anyway, these two colors can barely be distinguished and should consequently be changed. Eliko (talk) 17:24, 3 January 2008 (UTC)
Age Difference?
Can a male/female life expectancy 'age difference' column be added? Icarusii (talk) 22:54, 14 January 2008 (UTC)
- Disagree. This can easily be deduced by simple subtraction, and the specificity of the information is beyond the scope of the article.Forbes72 (talk) 21:13, 24 January 2012 (UTC)
UN list
I've just edited the UN list in a similar way the CIA list is presented. If u have any comments / suggestions about the changes, please let me know. What is the original source of the list? Panos84
Cia new list updated
The CIA now have the 2008 list of countries by life expectancy. When will the UN update a new list for 2007?
Thanks
☆ Muzammil, مزمل ☆ (talk) 07:28, 1 May 2008 (UTC)
Flag of Saint-Pierre and Miquelon
The local flag seems to be different from what is shown on the list. Should this be adapted ? Lars 09:50, 10 July 2008 (UTC)
Am I missing something?
The list of countries doesn't give a UN member state rank for the UK. I was wondering if that was an omission or if maybe I missed some major development recently? Mcrabb23 (talk) 07:04, 6 October 2008 (UTC)
- Done The UK entry under the CIA list does properly give a UN member state rank.(#20)Forbes72 (talk) 21:10, 24 January 2012 (UTC)
life expectancies at some later age?
The rankings in this table, being life expectancy from birth, are to a large degree a measure of infant mortality rates. It would be useful if there were sources on how countries vary when it comes to life expectancy from some later age, like at age 5, or at age 15. --Delirium (talk) 20:23, 29 October 2008 (UTC)
Life expectancy at 60, for example, would place USA near the top of the list. ~~
- Life expectancy at other ages is interesting information, but is beyond the scope of this article. While "life expectancy" doesn't explicitly state that it must be measured from birth, in and of itself it strongly implies "life expectancy at birth"; the definition at the beginning of the article and the caption on the first image both support this. Adding another list would take away from the focus of this article I think.Forbes72 (talk) 21:32, 24 January 2012 (UTC)
Spain, Norway and Israel
Isn't it a bit strange that these three countries have exactly the same values for the male (76.46), female (83.32) and total (79.78) life expectancy (according to the CIA World Factbook)?
Looks like someone copied the same line three times. 85.52.162.4 (talk) 02:18, 1 December 2008 (UTC)
- Done This is no longer the case.Forbes72 (talk) 21:35, 24 January 2012 (UTC)
New Discussion
A discussion has been started at Wikipedia talk:WikiProject Countries/Lists of countries which could affect the inclusion criteria and title of this and other lists of countries. Editors are invited to participate. Pfainuk talk 11:16, 17 December 2008 (UTC)
UN figures
Where are the male & female UN figures coming from? They aren't in here. They also don't seem to match WTO data for 2006. For Russia WTO data states, males: 60.1 females: 73.2. Sotnik (talk) 04:25, 7 April 2009 (UTC)
CIA 2009
The 2009 factbook is now out - how is the update done. Does someone have to type in the individual figures - or is there a nifty script somewhere —Preceding unsigned comment added by 131.236.30.159 (talk • contribs)
- I can do the update for you. But it won't probably be until tomorrow because it's getting late where I'm at. Elockid (talk) 02:10, 18 August 2009 (UTC)
- Done Okay it should be updated now. Elockid (talk) 19:30, 18 August 2009 (UTC)
Thanks - but just to satisfy my curiousity - was it with via a script, or manual entry (if its manual entry and I notice this year - I should probably do it myself, but if its a script I won't) —Preceding unsigned comment added by 121.127.209.202 (talk) 17:55, 19 August 2009 (UTC)
- It was manually done. It took me quite a while to do it too since it was all manual. Elockid (Talk·Contribs) 18:00, 19 August 2009 (UTC)
I suspect one country is missing in the CIA World Factbook list: only 191 UN member countries are ranked while UN has 192 member states. Who can find the mysterious missing country?LeQuantum (talk) 14:09, 2 November 2009 (UTC)
There is a new 2010 Life expectancy on the cia website. —Preceding unsigned comment added by 116.90.132.141 (talk) 21:26, 14 June 2010 (UTC)
"Average of World Countries" misleading
The first table has a row at the bottom "Average of World Countries" which, I'm guessing, simply adds up all the life expectancies and divides by the number of countries. This seems to be a fairly useless (and actually rather misleading) figure as it doesn't take population differences into account at all - Montserrat (population a few thousand) counts as much as China (population over a billion!) I'd say that we either need to remove the average entirely, or cross-reference to List_of_countries_by_population and properly weight the thing by population. Any ideas? Alex Whittaker (talk) 21:55, 20 August 2009 (UTC)
Actually, just cross-referenced the CIA World Factbook and the average is taken from there, which I assume means it has been done properly. The current wording doesn't really imply this though (looks like it was changed on 04/12/08 as perhaps the old table didn't have a correct average?) I'm changing the text to "Average (weighted by population)" to reflect this. Alex Whittaker (talk) 22:04, 20 August 2009 (UTC)
World Bank - US Census Bureau
Should we use either of these data sources on this page?
- US Census Bureau International Database - http://www.census.gov/ipc/www/idb/informationGateway.php
- World Bank - Economic Development Indicators - http://ddp-ext.worldbank.org/ext/DDPQQ/member.do?method=getMembers&userid=1&queryId=135
Nasa-verve (talk) 23:46, 16 September 2009 (UTC)
linked updated map to replace 2008 one
but do we need to wait until 2010 to get a 2009 map? I'll hace a crack at inkscaping the 2008 map for 2009. Map legend could do with a tweak. Nankai (talk) 06:17, 26 October 2009 (UTC)
Anguilla
I'm no mathematical genius, but unless it is completely devoid of women, how can Anguilla's male life expectancy (80.65) be the same as the total average (also 80.65) even though the average life expectancy for women is 83.26? —Preceding unsigned comment added by 220.236.170.233 (talk) 23:59, 13 November 2009 (UTC)
canada
what does "Canada (20% above world average)" mean?
212.247.86.210 (talk) 09:27, 25 November 2009 (UTC)
CIA 2010 numbers
The CIA fact book has published their 2010 numbers already: https://www.cia.gov/library/publications/the-world-factbook/rankorder/2102rank.html The U.S. has dropped to 49 and there are other major changes so it would be good to update.
Interesting, but there is a thing I fail to grasp fully. As can be seen life expectancy is closely related to human development, to economic development, to rich nations, in short. How come the US has such low life expectancy?. Boo.
Paulajakobs (talk) 15:37, 8 November 2010 (UTC)
- 2011 numbers are ready. Should we update?--RoadTrain (talk) 20:55, 26 March 2011 (UTC)
- The 2011 numbers have been implemented only partially I think. Based on a few comparisons, they agree with the CIA website [[9]] for some countries (e.g. Monaco & Macau) but not others (e.g. Romania & Jamaica) this may be related to which entries have a citation tag after the country name. What makes this more confusing is that the URL says "2012rank" but the data the CIA gives says "2011 est." The list needs to be rechecked, and then all the redundant citations should be consolidated into one on the title of the list I think.Forbes72 (talk) 21:57, 24 January 2012 (UTC)
Deviation of male and female life expectancies
I think that we should include the ALE of females compared to the ALE of males. would contribute to the article. 69.142.35.12 (talk) 14:45, 19 March 2011 (UTC)
New update for UNO report on life expectancy 2011
Can someone update the data from the UNO on life expectancy? The current data is very outdated because it was calculated in 2007. Here is the link with an excel file http://esa.un.org/unpd/wpp/Excel-Data/DB01_Period_Indicators/WPP2010_DB1_F05_1_LIFE_EXPECTANCY_0_BOTH_SEXES.XLS — Preceding unsigned comment added by 46.147.155.27 (talk) 18:29, 17 July 2011 (UTC)
Afghanistan
According to the World Health Organization (WHO), life expectancy in Afghanistan is 47: male 47 and female 50 (2009). [10] Afghanistan Mortality Survey (AMS) puts it 62-64 for both male and female (2011). [11]--Kiftaan (talk) 16:58, 13 December 2011 (UTC)
Male / Female Breakdown for UN 2005-2010
The source indicated (United Nations World Population Prospects: 2006 revision) does not contain breakdown for male/female life expectancy used in the article. It is necessary to fill it. Who knows where data is taken from? Front315 (talk) 09:36, 30 January 2012 (UTC)
- Done I have now updated the UN figures for WPP2010 and given source refs for male/female breakdown HYanWong (talk) 13:20, 15 January 2013 (UTC)
Russia, Ukraine etc, discussion of male/female difference in life expectancy.
I suggest the writer of this page to also include a discussion of Russia, Ukraine, Belarus etc. These countries have a very big difference between male and female life expectancy, which is due to a number of reasons, one typically cited is alcohol consumption. A discussion of the different reasons would be interesting. A suggestion could also be to add a column with the difference between male and female, so that one could sort on this column. — Preceding unsigned comment added by 88.147.21.3 (talk) 11:39, 4 February 2012 (UTC)
- I've lived in Ukraine for several years, and it seems that the gap is substantially wider in rural areas. The stats I've seen and read about before do hint that alcoholism is largely to blame for Russia's and Ukraine's low life expectancy, but alcoholism here, albeit probably more common among men, is by no means limited to the male portion of the population, so it's odd that the gap should be so prominent. EIN (talk) 20:36, 8 May 2013 (UTC)
"World Average" and other interspersed figures break when sorting by other than overall life expectancy
There are entries for World average and various percentages above and below world average. Since this is based on sorting by overall life expectancy, it is completely wrong when sorting by male or female life expectancy. I think these should be deleted. Bhawthorne (talk) 14:28, 13 April 2012 (UTC)
Median life expectancy
This article essentially discusses the mean age of death in different countries around the world. Is there no article for the median age of death for these countries? The difference between the mean and median can be very telling (as well as the standard deviation). I feel that this article could be much more beneficial if each chart included the mean and median, at least, as well as the standard deviation.
As an example, by these numbers, we can't be sure if people in Japan actually live longer lives or if there are less people dying at a younger age than in other countries. A bell curve showing live expectancy for each country would be informative but obviously not realistic for a single article.
That's just my two cents regarding a way to improve the page. OlYeller21Talktome 20:46, 19 July 2012 (UTC)
missing country
is there a reason that switzerland doesnt appear in the UN list? — Preceding unsigned comment added by 83.78.112.87 (talk) 02:23, 11 December 2012 (UTC)
New data available
In mid December 2012 the Global Burden of Disease initiative released new calculations of life expectancy for 187 countries (see Wang, H. et al.[2012]. Age-specific and sex-specific mortality in 187 countries, 1970-2010: a systematic analysis for the Global Burden of Disease Study 2010. Lancet, 380(9859), 2071–2094. doi:10.1016/S0140-6736(12)61719-X). For the first time, these figures also include standard errors of the estimates.
The data have also been made publicly available by The Guardian newspaper (see here). Should I produce a new table on this page with this new data? I also have an updated plot of male vs female LE based on this data (http://yanwong.me/blog/wp-content/uploads/2012/12/test.svg), which displays error bars rather than population size of country. Population size is indicated by depth of colour (so that larger countries are more emphasised). I was wondering whether to replace the plot at the top of the page with this new one? I can provide R code to reproduce this plot programmatically. HYanWong (talk) 14:33, 14 January 2013 (UTC)
- Now added. However, I couldn't find any figures summed for both sexes. Access to the original dataset unfortunately requires (free) registration. HYanWong (talk) 14:49, 15 January 2013 (UTC)
Updated UN WPP2010 figures
I've updated the table to give the most recent UN estimates. For future reference, including when new data become available, an appropriate wiki table can be produced from the online UN data using the following R code
require(gdata)
require(ISOcodes)
#get the spreadsheets from the UN
URL1 <- "http://esa.un.org/wpp/Excel-Data/DB01_Period_Indicators/WPP2010_DB1_F05_1_LIFE_EXPECTANCY_0_BOTH_SEXES.XLS"
URL2 <- "http://esa.un.org/wpp/Excel-Data/DB01_Period_Indicators/WPP2010_DB1_F05_3_LIFE_EXPECTANCY_0_FEMALE.XLS"
URL3 <- "http://esa.un.org/wpp/Excel-Data/DB01_Period_Indicators/WPP2010_DB1_F05_2_LIFE_EXPECTANCY_0_MALE.XLS"
uniqueHeaderText <- "Index"
Both <- read.xls(URL1, stringsAsFactors=FALSE, pattern=uniqueHeaderText, header=TRUE, row.names="Country.code")
Female <- read.xls(URL2, stringsAsFactors=FALSE, pattern=uniqueHeaderText, header=TRUE, row.names="Country.code")
Male <- read.xls(URL3, stringsAsFactors=FALSE, pattern=uniqueHeaderText, header=TRUE, row.names="Country.code")
use <- rownames(Both)[as.numeric(rownames(Both)) <= 900]
#make some shorter country names, as in previous wikipedia tables. Some of these are arguable
data(ISO_3166_1)
ISO_3166_1$Common_name[match('PRK', ISO_3166_1$Alpha_3)] <- 'North Korea'
ISO_3166_1$Common_name[match('KOR', ISO_3166_1$Alpha_3)] <- 'South Korea'
ISO_3166_1$Common_name[match('IRN', ISO_3166_1$Alpha_3)] <- 'Iran'
ISO_3166_1$Common_name[match('TZA', ISO_3166_1$Alpha_3)] <- 'Tanzania'
ISO_3166_1$Common_name[match('ABW',ISO_3166_1$Alpha_3)] <- 'Aruba (Netherlands)'
ISO_3166_1$Common_name[match('BRN',ISO_3166_1$Alpha_3)] <- 'Brunei'
ISO_3166_1$Common_name[match('COD',ISO_3166_1$Alpha_3)] <- 'Democratic Republic of the Congo'
ISO_3166_1$Common_name[match('FSM',ISO_3166_1$Alpha_3)] <- 'Federated States of Micronesia'
ISO_3166_1$Common_name[match('FRA',ISO_3166_1$Alpha_3)] <- 'France ([[metropolitan France|metropol.]])'
ISO_3166_1$Common_name[match('GUF',ISO_3166_1$Alpha_3)] <- 'French Guiana (France)'
ISO_3166_1$Common_name[match('PYF',ISO_3166_1$Alpha_3)] <- 'French Polynesia (France)'
ISO_3166_1$Common_name[match('GLP',ISO_3166_1$Alpha_3)] <- 'Guadeloupe (France)'
ISO_3166_1$Common_name[match('GUM',ISO_3166_1$Alpha_3)] <- "Guam (US)"
ISO_3166_1$Common_name[match('HKG',ISO_3166_1$Alpha_3)] <- "Hong Kong (People's Republic of China)"
ISO_3166_1$Common_name[match('LAO',ISO_3166_1$Alpha_3)] <- "Laos"
ISO_3166_1$Common_name[match('MAC',ISO_3166_1$Alpha_3)] <- "Macau (People's Republic of China)"
ISO_3166_1$Common_name[match('MKD',ISO_3166_1$Alpha_3)] <- "Macedonia"
ISO_3166_1$Common_name[match('MTQ',ISO_3166_1$Alpha_3)] <- 'Martinique (France)'
ISO_3166_1$Common_name[match('NCL',ISO_3166_1$Alpha_3)] <- 'New Caledonia (France)'
ISO_3166_1$Common_name[match('PSE',ISO_3166_1$Alpha_3)] <- 'Palestinian territories'
ISO_3166_1$Common_name[match('PRI',ISO_3166_1$Alpha_3)] <- 'Puerto Rico (US)'
ISO_3166_1$Common_name[match('REU',ISO_3166_1$Alpha_3)] <- 'Réunion (France)'
ISO_3166_1$Common_name[match('STP',ISO_3166_1$Alpha_3)] <- 'São Tomé and Príncipe'
ISO_3166_1$Common_name[match('VIR',ISO_3166_1$Alpha_3)] <- 'U.S. Virgin Islands (US)'
shortnames <- with(ISO_3166_1, ifelse(is.na(Common_name), Name, Common_name))
names(shortnames) <- as.numeric(ISO_3166_1$Numeric)
shortnames <- append(shortnames, c('830'="[[Channel Islands]] (UK)", '530'='Netherlands Antilles (Netherlands)', '900'="{{noflag}}{{Background color|#98fb98|'''- Worldwide average -'''}}"))
#make the table of countries only (plus world summary)
LEtable <- data.frame(row.names=use, Country=shortnames[use], Overall=Both[use, "X2005.2010"], Male=Male[use, "X2005.2010"], Female=Female[use, "X2005.2010"])
#add flags for wikipedia where appropriate, and rank order with ties marked by '='
LEtable$Country <- sub('^([^([{]+\\b)', '{{flag|\\1}}', LEtable$Country)
LEtable$Country <- sub('\\(([^([{]+)\\)', '({{flag|\\1}})', LEtable$Country)
Rank <- as.character(rank(-LEtable$Overall, ties.method = "min"))
LEtable$Rank <- ifelse(duplicated(Rank) | duplicated(Rank,fromLast = TRUE), paste(Rank, "=", sep=""), Rank)
#output wikitable to paste into wikipedia
wikitable.start <- '{| class="wikitable sortable"\n|+ Life expectancy at birth (years)\n|-\n!Rank !! [[sovereign state|state]]/territory !! Overall !! Male !! Female\n'
wikitable.end <- '|}'
cat(wikitable.start, with(LEtable[order(LEtable$Overall, decreasing=TRUE),], sprintf("|-\n| %s || %s || %0.2f || %0.2f || %0.2f\n", Rank, Country, Overall, Male, Female)), wikitable.end, sep='')
HYanWong (talk) 12:47, 15 January 2013 (UTC)
Possible misleading stats
the life expectancy numbers are misleading because they do not seem to take into account the fact that in some cultures (countries) gender based infanticide is common. It must by default have a significant effect on the life expectancy numbers in countries where there are major differences in adult gender populations. — Preceding unsigned comment added by AGeneralist (talk • contribs) 17:02, 7 February 2013 (UTC)
Why Russia is colored as Central Asia?
Russia does not have a single region belonging to Central Asia. Why it is colored so on the chart?--Anixx1 (talk) 13:54, 23 April 2013 (UTC)
New article on Mediterranean diet and life expectancy
http://www.theguardian.com/world/2013/mar/05/spanish-highest-life-expectancy-europe
Pipo.