Thursday, May 30, 2013

Enkele bedenkingen bij de recente "De Standaard/VRT/TNS" peiling

Ik geef geregeld commentaar op de verslaggeving over peilingen en aanverwante onderwerpen op deze blog. Bij de recente DS/VRT peiling heb ik dat niet gedaan, omdat ik al bij al vond dat de verslaggeving niet zo slecht was. Ik heb niet alle artikels gelezen, maar in het algemeen staarde m'n zich niet blind op kleine verschillen en werd de betrekkelijkheid van de resultaten vrij goed onderstreept. Tussen haakjes, Maarten Lambrechts (@maartenzam) maakte wel een aardig overzicht van de verschillende visuele weergaven van de peilingsresultaten.

Ik was dus niet van plan om te regearen, maar, op populair verzoek (nu ja, enkel @janvandenbulck) toch enkele bedenkingen, met name over een twitter conversatie tussen @OmbudsDS en @maartencorten. Het uitgangspunt was de bijdrage van @OmbudsDS waarin hij schreef dat de berichtgeving over de peiling in zijn krant over het algemeen goed was. Eén van de argumenten was dat de berichtgeving zich spitste op de significante daling voor de NVA en niet op de kleinere verschillen. @maartencorten reageerde daarop met de volgende tweet:

Je zegt: verlies N-VA significant want betr.-interval 3%. Maar ijkingspunt is óók interval. Beetje flou, niet?

Op het eerste zicht lijkt de redering van @maartencorten steek te houden, immers beide cijfers komen van twee (onafhankelijke) steekproeven waarbij je voor elk een betrouwbaarheidsinterval kan berekenen. De redenering zou dan zijn dat men enkel van een significante verandering zou kunnen spreken indien de twee betrouwbaarheidsintervallen elkaar niet overlappen.

Het blijkt verrassend moeilijk te zijn om uit te leggen waarom de redenering van @maartencorten niet helemaal klopt. Ik zal toch enkele pogingen doen.

De meest eenvoudige manier om dat te doen is via de klassieke hypothese toetsen. Je probeert de hypothese dat de proportie NVA-stemmers een bepaalde waarde heeft te verwerpen. Die bepaalde waarde van de hypothese kan van eender waar komen, bv. van de vorige verkiezingsuitslag, van een politieke wetenschapper of van de schatting van een vorige peiling. Persoonlijk vind ik deze uitleg niet echt overtuigend omdat je in het laatste geval kunt stellen dat je niet helemaal zeker bent over de hypothese (de hypothese kwam immers zelf uit een peiling en is dus ook onderhevig aan steekproeffluctatie en dus onzekerheid). Bemerk in dat verband trouwens dat de redenering van @maartencorten, met een beetje goede wil, aansluit bij de school van de Bayesiaanse statistiek.

Een andere manier om het uit te leggen is erop wijzen dat de redenering uiteindelijk steunt op een hardnekkig misverstand rond betrouwbaarheidsintervallen. Ik geef toe, het gaat om een subtiliteit, maar deze subtiliteit ligt m.i. aan de grondslag van de redenering van @maartencorten. In wikipedia staat dit vrij goed uitgelegd:

Als we op grond van een steekproef een 95% betrouwbaarheidsinterval voor een populatiegemiddelde µ berekend hebben, kunnen we NIET zeggen dat er 95% kans is dat µ in dat interval ligt! Immers: µ ligt er in of µ ligt er niet in, een van beide.

Als je dit vreemd vind, geen nood, een prof. in politieke wetenschappen en een beroepsorganisatie van marktonderzoekers maakten onlangs net deze fout.

Goed, wat moet het dan wel zijn (cfr. 'Het is maar een peiling' van Frank Thevissen):

Indien we het onderzoek 100 keer zouden herhalen, dan zal de werkelijke waarde minstens 95 keer binnen het vooropgestelde betrouwbaarheidsinterval liggen. 

Dat is dus niet hetzelfde als zeggen dat er 95% kans is dat de werkelijke score van NVA in het betrouwbaarheidsinterval ligt. Het is dan ook weinig zinvol om zonder meer rond de twee steekproefschattingen betrouwbaarheidsintervallen berekenen en kijken naar de mate van overlap.

De derde, en allicht beste, manier is om een meer aangepaste test te doen waarin dit probleem expliciet wordt opgelost. Ik zou hier een gewone $\chi^2$ test doen. Als ik me bij het rekenen niet vergist heb is de waarde van de $\chi^2$-toets-statistiek hier 4.08 wat hoger is dan de kritische waarde van 3.84 (Bij 1 vrijheidsgraad en de gebruikelijke betrouwbaarheid van 95%). Er is dus een significante daling. Je kan wel niet zeggen dat die daling (minstens) 4% bedraagt (zelfs niet met een een betrouwbaarheid van 95%).

Ik wil er tenslotte nog op wijzen dat deze redeneringen enkel gelden indien aan alle statistische voorwaarden voldaan is (bv. het moet gaan om een aselect steekproef, enzovoort). Heel wat mensen merken op dat in de praktijk zelden aan die voorwaarden is voldaan en stellen dat klassieke opiniepeilingen niet geschikt zijn om verschuivingen van het electoraat te meten. Persoonlijk ben ik het eens met die kritiek, maar vind de alternatieven (panelonderzoek) ook niet zonder problemen.

Besluit: @OmbudsDS heeft m.i. gelijk, maar @maartencorten is een crypto-Bayesiaan, wat ook niet slecht is.

Saturday, May 11, 2013

A reaction on "On a First-name Basis with Success? Your Mom Chose Your Name Wisely."

Earlier this week, the Business section of the Flemish quality newspaper 'De Standaard' reported that the shorter the first name, the higher the income (see here). The article showed a pricture of Bill Gates, with the caption: "Was using the nickname 'Bill' the key to the success of William Henry Gates?". The newspaper was refering to research carried out by TheLadders, a "job-matching service for career-driven professionals" and reported here. Basically, they analyzed data around first names from TheLadders’ nearly 6 million members and salary level.
The blog is more tongue in cheek than De Standaard article led us to believe, but the blog has found its way in social media, being liked and tweeted more than thousand times, and was caught up by the popular (and sometimes serious) press. There are, however, a few concerns with this research. Let me mention them one by one:

  • The first concern is an obvious one: "Correlation is not causation". It's been said many times before, so  I don't need to do much explaining here, but it remains surprising to see that a lot of the reactions on the research really focused on the causal consequences. The Bill Gates example mentioned above is a case in point. The author's conclusion "to all prospective mothers, our advice is to keep Baby’s name short and sweet – your child will thank you when they’re raking in the money one day" was meant as humor, I suppose.
  • The second concern is related to the first one, and that's spurious correlation: The observed relationship might be caused by a third, unseen factor (sometimes referred to as a "confounding factor" or "lurking variable"). To the rearcher's credit the fact that he did a separate analysis for women and for men already eliminates gender as such a confounding factor. But nonetheless it is perefectly imaginable that length of first name is related to age or ethnicity, two factors that have been reported to influence salary in previous research.  I don't have the data available right here, but I'm sure that it wouldn't be hard to figure out whether certain age cohorts of people were given longer names than other cohorts, for instance because long names might become fashionable or out of fashion again. Likewise, it can't be hard to show that certain enhnicities have in general longer or shorter names than others. 
  • Another concern is the poor and confusing scientific language that is used. One example is "We wanted to prove the null hypothesis that what your mother names you makes a difference.". Null is misplaced here. I would rather say that we attempt to disprove the null that there is no difference. Sentences like "The definitive proof for this theory can be seen in Sara vs. Sarah, Michele vs. Michelle, or Philip vs. Phillip –  one letter less positively correlates with increased salary." should be avoided as well.
  • Another statistical concern is that  if you use 6 million observation almost everything will become significant, but that does not mean the reported effect is substantial as well.
  • While 6 million observations is huge, it does not mean that they are representative for the global population.
  • And if you consider the 6 million  people as your population (to avoid the problem in the previous bullet), the is no real need to use inductive statistics in the first place.
  • The graph with the average salaries by length of first name is somewhat misleading because the y-axis is not given and it is not exactly clear what scale is being used. 
  • While the regression coefficient is given, it would have been good to report the $R^2$ as well. 
To illustrate how easy it is to report effects like these, while they're (likely) not there or very weak, let me get back to the election data I used in a pevious post in this blog. It's data on the results of the municipal elections in Flanders in 2012.
For each of the about 37000 candidates from more than 300 municipalities I calculated the number of characters in their first name and related that to the number of votes they received relative to the result of their party in their municipality. Below I tried to mimic the graph produced by TheLadders (and shown above). It is a histogram of frequencies superimposed with the average percentage of votes.


As you can see, the two graphs look pretty similar both in terms of pattern of frequencies and in terms of the decreasing red line. This graph (wrongly) suggests that there is a tendency that longer first names have a lower (relative) number of votes. Before you jump to conclusions, please read further.
I used a couple of tricks to exagerate the effect. Many of these tricks were applied by the TheLadder author as well:

  1. By omitting labels on the y-axis, it is difficult to judge the scale.
  2. There are names with only two letters and with more than 9. In my example I used the same buckets as TheLadder. If I had allowed names with 2 characters as well, the line would have looked different. In Flanders the majority of those names are "An", which is a female name. I don't know how that works in the US, but there are names like 'Al' that must come up frequently in the huge database TheLadder has used
  3. The red line really hides the enormous variation in percentage of votes within each class of 'number of characters of the first name'.
  4. By not reporting the $R^2$ of the model, I deny the reader to evaluate the strength of the model themelves. In this case here, while the regression coefficient is significant, the $R^2$ of the regression model explains less than 1% of the variance, so the effect is clearly not substantial. Notice that the opposite is not true. Having a high $R^2$ does not always indicate a strong relationship either, but that is a different story.
  5. I've scaled my graph such that the decrease in the red line looks more dramatic (in all fairness I have to say that TheLadder author didn't do that).  


One more thing: Here's a list of candidates with names of length 11 with the frequency below each name:
Jean-Pierre Marie-Paule Jean-Claude Christianne Marie-Josée Anne-Sophie Christopher Marie-Elise 
         62          13           8           7           6           5           3           3 
Jean-Michel Ann-Pascale Anne-Claire Bernhardien Cemil-Jimmy Christianna Christoffer Danny-Spock 
          2           1           1           1           1           1           1           1 
Gust-Julien Guy-Maurice Hanne-Loren Hendrik-Jan Jan-Laurens Jean-Hubert Liese-Lotte Luigia-Gina 
          1           1           1           1           1           1           1           1 
Marie-Berte Marie-Josee Marie-Laure MarieJeanne Maximiliaan Pieter-Paul Salah-Edine Sebiha-Abla 
          1           1           1           1           1           1           1           1 
 
If you are familiar with names in Flanders you will agree that a lot of the higher frequency names are probably from older people, illustrating that behind "length of first name" lies a lurking variable, i.e. age.

I'm just giving this illustration, to show how easy it is to fool the (untrained) eye. Data scientists should avoid this kind of tricks and go for clarity instead.

Conclusion: Anyone who writes an article to pay respect to their mother has my support, but the article of TheLadder probably did not deserve to be spread as far as it did, and it certainly should not end up in a quality newspaper that De Standaard claims to be.