Skip to content

Instantly share code, notes, and snippets.

@mhermans
Last active January 7, 2022 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhermans/75e559d7d1f659df855766f13e4a6d9d to your computer and use it in GitHub Desktop.
Save mhermans/75e559d7d1f659df855766f13e4a6d9d to your computer and use it in GitHub Desktop.
Visualise trendlines with "open" datapoints: support for government measures against income differences, 2002-2008
essround essround_year country_iso2c country_name_en gincdif n n_se pct
1 2002 BE Belgium Agree strongly 455.8474083830247 24.072560533532695 0.2402389636447017
1 2002 BE Belgium Agree 874.3859045814513 31.81838872669106 0.4608155265976179
1 2002 BE Belgium Neither agree nor disagree 222.14182432630625 15.803401128924667 0.11707233753417241
1 2002 BE Belgium Disagree 230.61341530385303 15.400839428531011 0.12153700312059507
1 2002 BE Belgium Disagree strongly 62.615122103693565 9.506878776946055 0.032999182985457044
1 2002 BE Belgium No answer 51.87124555313497 9.213506189195183 0.02733698611745588
1 2002 DE Germany Agree strongly 377.1438310354219 22.063114818446433 0.1258549246801835
1 2002 DE Germany Agree 1219.241623744965 41.250031564681194 0.4068674868738743
1 2002 DE Germany Neither agree nor disagree 519.7322472538389 26.613296784096732 0.17343744600677538
1 2002 DE Germany Disagree 700.5852827794282 31.723215447068956 0.23378907658168416
1 2002 DE Germany Disagree strongly 127.58147280742232 14.027340240469375 0.04257462360363238
1 2002 DE Germany Don't know 52.370873855238436 9.579497574756294 0.017476442253850297
1 2002 FR France Agree strongly 706.7487622431408 32.626856354076914 0.46669647118042157
1 2002 FR France Agree 567.7978739799634 28.99650902697857 0.3749412496870155
1 2002 FR France Neither agree nor disagree 95.34616579842718 11.157895104866066 0.06296115606552834
1 2002 FR France Disagree 82.72487603026566 9.273587457413676 0.05462677797924579
1 2002 FR France Disagree strongly 45.175069294582904 7.194416015110534 0.02983103268295462
1 2002 FR France Don't know 16.572168367578193 5.293453137767893 0.010943312404834158
1 2002 GB UK Agree strongly 298.03622222722896 20.79330048166542 0.11557007146558683
1 2002 GB UK Agree 1277.3825705314373 44.90727607598103 0.4953330634175707
1 2002 GB UK Neither agree nor disagree 397.0177063124888 25.493733784730278 0.15395230938290203
1 2002 GB UK Disagree 505.36946393650163 28.29297123213225 0.19596807605196784
1 2002 GB UK Disagree strongly 66.0449848361758 10.104700471969304 0.02561038910109729
1 2002 GB UK Don't know 34.98471823927544 7.425056339514578 0.013566090580875342
1 2002 IT Italy Agree strongly 398.2064751643083 22.225324023506527 0.32991422963074435
1 2002 IT Italy Agree 513.5086146915531 24.88014420064417 0.4254420999930019
1 2002 IT Italy Neither agree nor disagree 156.14455259487548 13.840958871436678 0.12936582650776762
1 2002 IT Italy Disagree 77.62730864896069 10.265589088146394 0.06431425737279264
1 2002 IT Italy Disagree strongly 17.269797469321997 6.102875280213778 0.014308034357350459
1 2002 IT Italy Don't know 44.24325143097991 7.271150384054765 0.036655552138342935
1 2002 NL Netherlands Agree strongly 220.3461060962027 15.865366135280667 0.09320901273105009
1 2002 NL Netherlands Agree 1133.0072746719422 37.86142440502917 0.47927549690014415
1 2002 NL Netherlands Neither agree nor disagree 345.187553643128 20.81788878296331 0.14601842370690674
1 2002 NL Netherlands Disagree 563.328572088508 27.730184816138003 0.23829465824386942
1 2002 NL Netherlands Disagree strongly 78.47450293414843 10.221693386391829 0.03319564421918288
1 2002 NL Netherlands Don't know 23.655990566073825 6.273545499563807 0.010006764198846782
1 2002 NO Norway Agree strongly 320.03301445626363 19.088381800186088 0.15718713873097426
1 2002 NO Norway Agree 1106.1242957573645 35.08510472171495 0.543283052926014
1 2002 NO Norway Neither agree nor disagree 281.15885123014687 18.61816468003488 0.13809373832521946
1 2002 NO Norway Disagree 293.6437826363126 17.695488428571704 0.14422582644219675
1 2002 NO Norway Disagree strongly 28.057376195043616 5.933649914037053 0.013780636638037138
1 2002 NO Norway Don't know 6.98267972486891 2.9442907752022505 0.0034296069375584033
2 2004 BE Belgium Agree strongly 420.40824733019576 21.513599608314813 0.23645008286287736
2 2004 BE Belgium Agree 749.2566421707487 28.343784086892338 0.42140418569783406
2 2004 BE Belgium Neither agree nor disagree 268.79555275704905 16.983418027050032 0.15117860110070255
2 2004 BE Belgium Disagree 265.53905754540244 16.700166570600587 0.14934705148785296
2 2004 BE Belgium Disagree strongly 63.87371328339194 8.236680357706435 0.035924473162762635
2 2004 BE Belgium Don't know 10.126786913211301 3.3263842295567088 0.005695605687970363
2 2004 DE Germany Agree strongly 396.7638206051824 21.832965436683505 0.13824523366034133
2 2004 DE Germany Agree 1133.1307613962329 37.5619785898968 0.39481908062586235
2 2004 DE Germany Neither agree nor disagree 575.4684777498088 28.68303145108515 0.20051166472118634
2 2004 DE Germany Disagree 516.0188911532259 24.961529566947284 0.17979752304990326
2 2004 DE Germany Disagree strongly 122.50671961063567 11.954563507223742 0.042685268157015614
2 2004 DE Germany Don't know 126.11132948493449 14.360521194534014 0.04394122978569115
2 2004 FR France Agree strongly 877.9371296732311 35.04322760771454 0.48301587992510386
2 2004 FR France Agree 631.2982787523414 31.29765118349115 0.34732224358737374
2 2004 FR France Neither agree nor disagree 160.5077656876918 14.717357613232391 0.08830677853584887
2 2004 FR France Disagree 100.34231831506781 11.749089801780796 0.05520547148144512
2 2004 FR France Disagree strongly 41.9604592420254 7.934137339505326 0.02308544365858175
2 2004 FR France Don't know 5.569506043710768 2.4835307508910525 0.003064182811646684
2 2004 GB UK Agree strongly 288.5362982543446 19.038732593324006 0.15210136966491514
2 2004 GB UK Agree 812.9392962394562 32.2492406080217 0.4285394286976566
2 2004 GB UK Neither agree nor disagree 424.0033214914603 23.644315521038145 0.22351255745464388
2 2004 GB UK Disagree 292.2936708620285 19.304425486026894 0.1540820616035993
2 2004 GB UK Disagree strongly 47.38859201099889 8.576494280240407 0.024980807596731047
2 2004 GB UK Don't know 31.838821141715425 5.928211779483417 0.016783774982454064
2 2004 NL Netherlands Agree strongly 272.9163742327256 18.17272048126677 0.14509110804504288
2 2004 NL Netherlands Agree 715.9461088484206 29.896699669461434 0.3806199409082513
2 2004 NL Netherlands Neither agree nor disagree 344.16852252439645 21.986404685469015 0.18297103802466586
2 2004 NL Netherlands Disagree 471.04273173818905 26.680943835068817 0.2504214416470968
2 2004 NL Netherlands Disagree strongly 63.082228338556455 9.37137867246254 0.033536538191683396
2 2004 NL Netherlands Don't know 13.844034317711671 3.7113597492099473 0.007359933183259794
2 2004 NO Norway Agree strongly 395.7892394738646 21.136488504163417 0.22488024970105921
2 2004 NO Norway Agree 743.4371210576464 28.990768184208903 0.42240745514638967
2 2004 NO Norway Neither agree nor disagree 371.75567202561916 20.79155915581479 0.21122481365091977
2 2004 NO Norway Disagree 211.58250974118343 14.868398424878166 0.12021733508021774
2 2004 NO Norway Disagree strongly 30.95422661405824 5.784455585665302 0.01758762875798762
2 2004 NO Norway Don't know 6.481231087629635 2.97608009927274 0.003682517663425926
3 2006 BE Belgium Agree strongly 497.9336239132468 23.542165171743846 0.27695548425926775
3 2006 BE Belgium Agree 733.8544000794816 28.105109593250905 0.4081768954514666
3 2006 BE Belgium Neither agree nor disagree 269.5975611044404 17.07354156068401 0.14995276379208064
3 2006 BE Belgium Disagree 235.33744775426504 15.533381545861294 0.13089695830317802
3 2006 BE Belgium Disagree strongly 56.11190490407142 7.890157271489967 0.031209982714733575
3 2006 BE Belgium Don't know 5.048304184970892 2.949332245537917 0.002807915479273392
3 2006 DE Germany Agree strongly 480.53475074972266 24.458531884832936 0.16479243852871064
3 2006 DE Germany Agree 1255.3198440201243 40.775961579305914 0.43049377366945063
3 2006 DE Germany Neither agree nor disagree 554.9524422073522 27.033955723947415 0.190312908850257
3 2006 DE Germany Disagree 427.9215280096682 23.01607286530593 0.14674949520221744
3 2006 DE Germany Disagree strongly 92.23499656572872 11.528057373319509 0.0316306572584802
3 2006 DE Germany Don't know 105.0364384474185 12.927636597134086 0.03602072649088408
3 2006 FR France Agree strongly 883.4678655809735 34.55758401736767 0.4448478678655447
3 2006 FR France Agree 698.911674262494 30.178281504447806 0.3519192720354948
3 2006 FR France Neither agree nor disagree 182.649117531847 16.05325440247651 0.09196833712580395
3 2006 FR France Disagree 143.795595471113 13.363330076194629 0.07240463014658244
3 2006 FR France Disagree strongly 68.29229116362055 9.592036494990785 0.034386853556707155
3 2006 FR France Don't know 8.883455989955875 3.39699688002666 0.0044730392698669975
3 2006 GB UK Agree strongly 386.0463755421216 23.391052134291805 0.1296469569185043
3 2006 GB UK Agree 1275.1493771252276 45.89054106007979 0.42823672707367244
3 2006 GB UK Neither agree nor disagree 644.9298772083177 31.945614211075124 0.2165884756422483
3 2006 GB UK Disagree 511.6934856471665 28.93314898633548 0.1718433522294245
3 2006 GB UK Disagree strongly 114.52530519390587 13.443185640851283 0.03846133068262111
3 2006 GB UK Don't know 45.3296004698067 8.799924912152216 0.015223157453529357
3 2006 NL Netherlands Agree strongly 267.26846260407075 17.38100577756142 0.1414867456877029
3 2006 NL Netherlands Agree 793.0872109035057 31.34538679126572 0.41984500312520157
3 2006 NL Netherlands Neither agree nor disagree 342.3686672883109 21.369138426682547 0.181243338956226
3 2006 NL Netherlands Disagree 403.83855473264185 23.31833930260282 0.21378430636984747
3 2006 NL Netherlands Disagree strongly 66.52519106292557 9.32748016623159 0.03521714720112524
3 2006 NL Netherlands Don't know 15.911913408545129 3.742863939930753 0.008423458659896839
3 2006 NO Norway Agree strongly 310.1081129847609 18.762994985703646 0.1773396619359359
3 2006 NO Norway Agree 769.1200823756725 29.479640325476932 0.4398320768968194
3 2006 NO Norway Neither agree nor disagree 355.9026709621968 19.80592061448577 0.20352792045022758
3 2006 NO Norway Disagree 265.3030039304479 16.830150253893475 0.15171723362789266
3 2006 NO Norway Disagree strongly 41.08458541420575 6.4950725006922 0.023494794824962768
3 2006 NO Norway Don't know 7.149099009727783 4.450774371701946 0.00408831226416176
4 2008 BE Belgium Agree strongly 461.1124395233763 22.197947921895786 0.2619957042746458
4 2008 BE Belgium Agree 769.8519262167731 28.853146791612957 0.43741586716862135
4 2008 BE Belgium Neither agree nor disagree 246.7163173411744 16.612018787725344 0.140179725762031
4 2008 BE Belgium Disagree 232.0556136155516 15.45659406385987 0.1318497804633817
4 2008 BE Belgium Disagree strongly 41.49612565550277 6.346992484442863 0.023577344122444773
4 2008 BE Belgium Don't know 8.767577647620609 2.9767515721585203 0.004981578208875349
4 2008 DE Germany Agree strongly 512.9841295351841 24.367546197257912 0.18647187551260774
4 2008 DE Germany Agree 1269.5340248753716 40.741945948193795 0.4614809250728357
4 2008 DE Germany Neither agree nor disagree 438.75525306642135 23.846916367910598 0.1594893686173832
4 2008 DE Germany Disagree 416.8263205878691 23.15685997818008 0.15151810999195525
4 2008 DE Germany Disagree strongly 64.14748882670887 8.598313000204998 0.023317880344132617
4 2008 DE Germany Don't know 48.752783108446216 8.334654200547766 0.017721840461085492
4 2008 FR France Agree strongly 860.389679708828 33.10849603458702 0.4150456727973122
4 2008 FR France Agree 773.6629429548192 31.867265380557026 0.3732093308995752
4 2008 FR France Neither agree nor disagree 226.98536078450908 17.39522980851912 0.10949607370212694
4 2008 FR France Disagree 127.18543206661765 12.148606104991341 0.06135331985847452
4 2008 FR France Disagree strongly 81.27836205324262 9.702574480504868 0.039208085891578696
4 2008 FR France Don't know 3.498222431983155 2.03348956688499 0.0016875168509325402
4 2008 GB UK Agree strongly 395.9457285753312 22.41660983912388 0.1683442723534571
4 2008 GB UK Agree 958.4926345518853 35.041594229923746 0.4075223786360055
4 2008 GB UK Neither agree nor disagree 476.66661154980216 25.172375873223956 0.20266437565892942
4 2008 GB UK Disagree 419.28917457041365 22.837283280924378 0.1782692068751758
4 2008 GB UK Disagree strongly 73.41165052780164 9.695383523204082 0.031212436448895244
4 2008 GB UK Don't know 28.194200224767037 6.117462259175289 0.011987330027537001
4 2008 NL Netherlands Agree strongly 228.24377461340117 16.409510576310886 0.12837107683543383
4 2008 NL Netherlands Agree 737.1663340463036 30.635144377114486 0.41460423737137475
4 2008 NL Netherlands Neither agree nor disagree 347.71904042002086 21.15847713603664 0.19556751429697478
4 2008 NL Netherlands Disagree 391.34130343326996 22.817801647426858 0.22010197043491017
4 2008 NL Netherlands Disagree strongly 62.120166081776205 8.67227289351122 0.0349382261427313
4 2008 NL Netherlands Don't know 11.409381405226648 3.1278224420246064 0.006416974918575174
4 2008 NO Norway Agree strongly 229.73376123139892 17.220542427603107 0.14831101435209684
4 2008 NO Norway Agree 707.820103706255 29.669852415654997 0.4569529397716283
4 2008 NO Norway Neither agree nor disagree 338.9753627845967 20.85582240166151 0.21883496629089436
4 2008 NO Norway Disagree 235.83450567971826 16.986281558277117 0.15224951948335527
4 2008 NO Norway Disagree strongly 30.312811753226914 5.526386046564971 0.019569278084717104
4 2008 NO Norway Don't know 6.3234548448103265 3.0287657711531297 0.004082282017308135
5 2010 BE Belgium Agree strongly 453.81280785610755 22.829902541801832 0.2663220703380934
5 2010 BE Belgium Agree 749.9524239499867 28.279301429434675 0.4401129248532821
5 2010 BE Belgium Neither agree nor disagree 258.31632843732376 16.97304157714252 0.15159408945852454
5 2010 BE Belgium Disagree 190.04945348986794 13.910743793168356 0.11153136941893746
5 2010 BE Belgium Disagree strongly 47.63272918788452 7.716849729135379 0.027953479570354985
5 2010 BE Belgium Don't know 4.236257078816126 2.139214956746065 0.0024860663608076055
5 2010 DE Germany Agree strongly 668.6150449495111 27.50048919221192 0.22059222862075603
5 2010 DE Germany Agree 1360.6175247996887 41.57899737793436 0.4489005360606036
5 2010 DE Germany Neither agree nor disagree 427.4895176547893 23.10496248333849 0.14103910183265905
5 2010 DE Germany Disagree 405.2360350789621 22.602207066526088 0.13369714123357385
5 2010 DE Germany Disagree strongly 110.41169640114005 11.527567087348837 0.03642748149163316
5 2010 DE Germany Don't know 58.630181115906666 9.518121908973724 0.019343510760774233
5 2010 FR France Agree strongly 701.7254166431859 30.689240282167383 0.40609109759443673
5 2010 FR France Agree 679.9851238301582 31.353881388717383 0.3935099096239345
5 2010 FR France Neither agree nor disagree 151.53901991846712 14.157072978639695 0.08769619208244635
5 2010 FR France Disagree 133.05963638854124 14.012684906271321 0.077002104391517
5 2010 FR France Disagree strongly 53.74418499510748 8.73457388892592 0.03110195890920575
5 2010 FR France Don't know 7.9466182245383035 3.330060541306819 0.004598737398459671
5 2010 GB UK Agree strongly 339.34146600290916 22.825878680486174 0.14010795458419079
5 2010 GB UK Agree 1087.173374955182 43.3374950084234 0.44887422582790454
5 2010 GB UK Neither agree nor disagree 443.5147397005658 27.595447513328885 0.18311921540072956
5 2010 GB UK Disagree 374.00783253781 23.985108134419132 0.1544210704119781
5 2010 GB UK Disagree strongly 79.27972238568557 12.145514069111671 0.03273316366048133
5 2010 GB UK Don't know 98.68286441784132 15.07506148869192 0.04074437011471576
5 2010 NL Netherlands Agree strongly 278.3846393733543 19.098493909907734 0.15220592639330413
5 2010 NL Netherlands Agree 743.5741454069282 31.290512694192685 0.40654682635698497
5 2010 NL Netherlands Neither agree nor disagree 306.5062481184529 20.42894977344884 0.16758132756613
5 2010 NL Netherlands Disagree 421.0669895253416 25.094561174603452 0.23021705277492624
5 2010 NL Netherlands Disagree strongly 66.88055546497652 10.323537999491382 0.036566733441758495
5 2010 NL Netherlands Don't know 12.587422110953119 4.408773997876269 0.006882133466896158
5 2010 NO Norway Agree strongly 191.17953762874924 14.792884764180465 0.12350099330022635
5 2010 NO Norway Agree 656.9360292810547 27.951485919394642 0.42437727989732477
5 2010 NO Norway Neither agree nor disagree 374.31139333977285 20.80077784598232 0.24180322567168935
5 2010 NO Norway Disagree 275.8795641156079 17.00876908379394 0.17821677268450228
5 2010 NO Norway Disagree strongly 39.98578858247506 6.283501953481548 0.02583061277937681
5 2010 NO Norway Don't know 9.707687052330922 3.7568141124937138 0.006271115666880478
6 2012 BE Belgium Agree strongly 488.60548356829923 22.70507235432248 0.2614261549322093
6 2012 BE Belgium Agree 845.9731676974732 29.495728039605556 0.45263411861823066
6 2012 BE Belgium Neither agree nor disagree 260.91935979295005 16.272226807790634 0.13960372380575176
6 2012 BE Belgium Disagree 197.7611380284179 14.016818259129792 0.10581120279744134
6 2012 BE Belgium Disagree strongly 60.8640643544522 7.77264767493667 0.03256504245824088
6 2012 BE Belgium Don't know 14.876786558407687 4.160221333417501 0.007959757388126102
6 2012 DE Germany Agree strongly 797.6462845860108 31.386714572736718 0.26965729702028757
6 2012 DE Germany Agree 1359.401642731521 41.417836434225705 0.45956783053803946
6 2012 DE Germany Neither agree nor disagree 404.9898344769054 22.995418446588932 0.13691339907941358
6 2012 DE Germany Disagree 338.80369364309286 21.142566619459295 0.1145380979185574
6 2012 DE Germany Disagree strongly 38.032770874747484 6.651278508936101 0.01285759664460699
6 2012 DE Germany Don't know 19.125773687722834 5.671359712349914 0.00646577879909494
6 2012 FR France Agree strongly 710.6575656740409 32.05825900792011 0.3611064866229883
6 2012 FR France Agree 758.9778154232954 33.631424232540056 0.3856594590565525
6 2012 FR France Neither agree nor disagree 225.80133510420154 17.526309098470286 0.11473645076433005
6 2012 FR France Disagree 158.4464371760441 14.482449104301507 0.08051140100408745
6 2012 FR France Disagree strongly 102.40467010431703 12.398163989337593 0.05203489334568955
6 2012 FR France Refusal 11.712176518101082 3.859292603302202 0.005951309206352176
6 2012 GB UK Agree strongly 386.0531777598245 22.701555592658888 0.16887715562547004
6 2012 GB UK Agree 1038.3731364061484 38.072958104134734 0.45423146824415944
6 2012 GB UK Neither agree nor disagree 422.02830370076083 24.4554551221307 0.18461430608082277
6 2012 GB UK Disagree 324.079381360244 20.19670398232857 0.1417670084690481
6 2012 GB UK Disagree strongly 46.36048650981912 6.906766423780156 0.020280177825817636
6 2012 GB UK Don't know 69.10551426320292 9.79702125516038 0.03022988375468194
6 2012 IT Italy Agree strongly 417.2930997379691 22.82274820423286 0.43468031222705117
6 2012 IT Italy Agree 371.9375202493318 21.163087051766297 0.38743491692638726
6 2012 IT Italy Neither agree nor disagree 100.57614785528925 10.827813689037772 0.10476682068259296
6 2012 IT Italy Disagree 46.59987877166592 7.264976873951288 0.048541540387152
6 2012 IT Italy Disagree strongly 7.820177099384696 3.363585172062401 0.00814601781185906
6 2012 IT Italy Don't know 15.77317628635924 4.232815996149733 0.01643039196495754
6 2012 NL Netherlands Agree strongly 243.00177257589033 17.184415705760912 0.13170827781891076
6 2012 NL Netherlands Agree 759.1102321947476 31.7561722426696 0.4114418602681559
6 2012 NL Netherlands Neither agree nor disagree 318.59108679836 20.95652789225683 0.17267809582566937
6 2012 NL Netherlands Disagree 438.7036243017684 26.42658489982652 0.23777974216898015
6 2012 NL Netherlands Disagree strongly 75.76012515398656 10.769759445008109 0.04106239845744529
6 2012 NL Netherlands Don't know 9.83315897524717 3.3668458301635398 0.005329625460838574
6 2012 NO Norway Agree strongly 214.83841572599295 15.654436401819575 0.13228966485590693
6 2012 NO Norway Agree 716.7206070542768 28.51688538173039 0.44133042306297815
6 2012 NO Norway Neither agree nor disagree 400.5530664022343 21.34832981603648 0.24664597684866635
6 2012 NO Norway Disagree 247.4898039052066 15.997819174680659 0.15239519944901878
6 2012 NO Norway Disagree strongly 34.68825458867719 5.887066795746034 0.021359762677756883
6 2012 NO Norway Don't know 9.709852323612724 3.801883693841676 0.005978973105672857
7 2014 BE Belgium Agree strongly 495.06032588230806 22.755865979255415 0.27985320852589485
7 2014 BE Belgium Agree 768.6291988136967 28.164260988835753 0.4344992644509308
7 2014 BE Belgium Neither agree nor disagree 229.86131863592422 15.345659917922953 0.12993856338944273
7 2014 BE Belgium Disagree 199.8229263821314 14.096726292890091 0.11295812684122747
7 2014 BE Belgium Disagree strongly 68.52766713379917 8.307395066301387 0.03873808204284859
7 2014 BE Belgium Don't know 7.09856315214073 2.7021701206974695 0.0040127547496555845
7 2014 DE Germany Agree strongly 673.9771672004006 28.492174720958037 0.2213389711659772
7 2014 DE Germany Agree 1511.9878750152486 44.37453861259302 0.49654774220533615
7 2014 DE Germany Neither agree nor disagree 397.79343584161575 22.25499529206282 0.1306382383716308
7 2014 DE Germany Disagree 398.3675706707419 22.19671362723188 0.13082678839761638
7 2014 DE Germany Disagree strongly 41.30636260170744 6.513110707429102 0.013565307915174858
7 2014 DE Germany Don't know 21.567588670285723 5.237056401724046 0.007082951944264605
7 2014 FR France Agree strongly 662.7971115983321 31.66631897172038 0.3457470587367408
7 2014 FR France Agree 679.1996482832266 31.095865177056588 0.35430341590152664
7 2014 FR France Neither agree nor disagree 255.18854724034375 19.51037847292045 0.13311869965589138
7 2014 FR France Disagree 190.95342114286123 17.748436195340005 0.09961054832700117
7 2014 FR France Disagree strongly 120.03591281563467 13.333876393762937 0.06261654293981986
7 2014 FR France Don't know 8.82535891960158 4.458543479959498 0.004603734439020126
7 2014 GB UK Agree strongly 448.5896626829759 23.715088572520703 0.1981403103723392
7 2014 GB UK Agree 962.1755598924607 37.18482739225286 0.42498920489949676
7 2014 GB UK Neither agree nor disagree 436.39600367841547 24.585764555159315 0.19275441858587256
7 2014 GB UK Disagree 323.2210817375904 20.39249269897363 0.14276549546713357
7 2014 GB UK Disagree strongly 69.32176936598431 9.36482641312761 0.030619156080381762
7 2014 GB UK Don't know 24.295922642573274 5.826182748043211 0.010731414594776181
7 2014 NL Netherlands Agree strongly 299.25494101300285 19.082370263674918 0.15594316884471227
7 2014 NL Netherlands Agree 749.4178848927035 32.05031544063664 0.3905252135970315
7 2014 NL Netherlands Neither agree nor disagree 375.6471417764202 23.28585529128763 0.1957515069184055
7 2014 NL Netherlands Disagree 422.22280602622385 24.396424903004274 0.2200223064232537
7 2014 NL Netherlands Disagree strongly 56.07679400725258 9.04984518111347 0.029221883276317133
7 2014 NL Netherlands Don't know 16.380432284397088 4.576301712732883 0.008535920940279879
7 2014 NO Norway Agree strongly 253.34883929021805 17.24024738353095 0.17642676830795126
7 2014 NO Norway Agree 572.8504148444507 25.41740401328918 0.3989209017022637
7 2014 NO Norway Neither agree nor disagree 350.9188826450685 19.864724116936447 0.24437248095060476
7 2014 NO Norway Disagree 220.68775577444072 15.466353214764966 0.15368228117997262
7 2014 NO Norway Disagree strongly 25.575848938192433 4.902671123381613 0.017810479761972444
7 2014 NO Norway Don't know 12.618258507629744 3.840832250115591 0.008787088097235196
8 2016 BE Belgium Agree strongly 493.56381231546396 22.803310165696978 0.2794812074455157
8 2016 BE Belgium Agree 792.1297222971916 28.610706482225098 0.44854457664250413
8 2016 BE Belgium Neither agree nor disagree 223.91398644447327 15.030931463462593 0.12679161181177123
8 2016 BE Belgium Disagree 210.62262970209122 14.606952121025287 0.11926536224026543
8 2016 BE Belgium Disagree strongly 39.624450743198395 6.376728135143433 0.022437401328353986
8 2016 BE Belgium Don't know 6.145398378372192 2.5519777056142323 0.00347984053158948
8 2016 DE Germany Agree strongly 728.2178907245396 31.032637378715876 0.2553358657072791
8 2016 DE Germany Agree 1311.9337703883648 41.78949827446367 0.46000482723575514
8 2016 DE Germany Neither agree nor disagree 416.15249045193195 24.233823826575104 0.14591602014894514
8 2016 DE Germany Disagree 326.2309774756431 20.58695335240141 0.11438673797398397
8 2016 DE Germany Disagree strongly 42.56041634082793 6.8885130153221645 0.014923007096729272
8 2016 DE Germany Don't know 26.904461383819584 5.984309008802472 0.009433541837307319
8 2016 FR France Agree strongly 735.1172422319651 32.95235296370366 0.3551291007686869
8 2016 FR France Agree 804.564849600196 35.04663800697499 0.38867866937945056
8 2016 FR France Neither agree nor disagree 244.64397549629214 18.80671797927409 0.11818549482350463
8 2016 FR France Disagree 180.71635755896565 15.291466729475882 0.0873025877603573
8 2016 FR France Disagree strongly 86.72844824194908 10.961396495243003 0.041897800875561775
8 2016 FR France Don't know 18.229137122631073 5.861976877023674 0.00880634639243885
8 2016 GB UK Agree strongly 378.86592823266983 22.60215485232506 0.19339761545800832
8 2016 GB UK Agree 877.0217480659485 34.6930070641634 0.44768848856898247
8 2016 GB UK Neither agree nor disagree 417.94647273421293 24.34564706998449 0.21334684697812914
8 2016 GB UK Disagree 228.58418557047844 17.195449481306124 0.11668411732604397
8 2016 GB UK Disagree strongly 41.234083324670806 7.396170948619495 0.02104853668892284
8 2016 GB UK Don't know 15.34757974743843 4.345612284638825 0.00783439497991328
8 2016 IT Italy Agree strongly 708.9644733071326 27.23450581810459 0.26997885518869935
8 2016 IT Italy Agree 1336.3713218569756 37.205906428629696 0.5088999705428897
8 2016 IT Italy Neither agree nor disagree 369.1863446235657 19.4877832774192 0.14058885942172092
8 2016 IT Italy Disagree 112.2621911764145 10.533735808831548 0.042750263230261036
8 2016 IT Italy Disagree strongly 14.744689464569085 4.012974650073813 0.005614885557224139
8 2016 IT Italy Refusal 84.4709780216217 9.522823429470707 0.03216716605920481
8 2016 NL Netherlands Agree strongly 248.4219819307327 17.1115175533468 0.14778226156365182
8 2016 NL Netherlands Agree 744.5001789331436 31.492867566310217 0.44289124224104004
8 2016 NL Netherlands Neither agree nor disagree 302.95207163691515 20.444924993324257 0.1802213392870371
8 2016 NL Netherlands Disagree 326.58375173807144 21.681759765921417 0.194279447602393
8 2016 NL Netherlands Disagree strongly 50.5635730922222 8.701698176201488 0.030079460465745462
8 2016 NL Netherlands Don't know 7.9784443080425245 2.6970624254898192 0.00474624884013255
8 2016 NO Norway Agree strongly 281.0034539103508 17.79366831121446 0.18187925852418815
8 2016 NO Norway Agree 656.9472740292549 28.158443330819527 0.42520859237569064
8 2016 NO Norway Neither agree nor disagree 377.29485827684397 21.141220249342016 0.24420379220774172
8 2016 NO Norway Disagree 183.50000303983688 13.647874411947246 0.11877022872010484
8 2016 NO Norway Disagree strongly 34.866417348384864 6.296114041809439 0.02256726046058589
8 2016 NO Norway Refusal 11.387990593910219 3.8107073270817478 0.00737086771168874
9 2018 BE Belgium Agree strongly 412.7623284757138 21.02757681759513 0.23359497832118023
9 2018 BE Belgium Agree 859.5642333626748 29.910782311502114 0.4864540065938456
9 2018 BE Belgium Neither agree nor disagree 248.0966957509518 16.1012290723965 0.14040559970556993
9 2018 BE Belgium Disagree 188.0647389292717 14.209395300725767 0.10643165711220293
9 2018 BE Belgium Disagree strongly 43.3249787092209 6.8006246254479334 0.024518946532063487
9 2018 BE Belgium Don't know 15.18703240156174 3.8741278831051953 0.008594811735137821
9 2018 DE Germany Agree strongly 619.4438524246216 27.159230200233633 0.2626988330790913
9 2018 DE Germany Agree 1111.6631042361262 36.53514930793521 0.4714432133224653
9 2018 DE Germany Neither agree nor disagree 305.1000870466233 18.808687956574413 0.12938934905198737
9 2018 DE Germany Disagree 251.31937471032143 16.999373251408066 0.10658158315422507
9 2018 DE Germany Disagree strongly 46.3665722310543 7.573436252316715 0.019663516509686514
9 2018 DE Germany Don't know 24.107024669647217 5.8979268486242296 0.010223504882544334
9 2018 FR France Agree strongly 808.4273654222488 33.671233371030176 0.4022026708074625
9 2018 FR France Agree 775.8753482401371 32.309087934046644 0.38600763732541626
9 2018 FR France Neither agree nor disagree 231.45474195480344 18.32683683183567 0.11515161332601767
9 2018 FR France Disagree 120.67611744999884 12.815185813624858 0.060037869593533175
9 2018 FR France Disagree strongly 55.97839581966399 8.429351505360541 0.02784994826891658
9 2018 FR France Don't know 17.588023900985725 4.600440355930805 0.008750260678653742
9 2018 GB UK Agree strongly 497.55273261666304 26.556176850542787 0.22574987621621756
9 2018 GB UK Agree 966.9919379353524 36.32042973734525 0.43874406867979754
9 2018 GB UK Neither agree nor disagree 448.690192848444 24.88970585441819 0.2035799400844749
9 2018 GB UK Disagree 244.77996405959135 18.033955371891217 0.11106168846878182
9 2018 GB UK Disagree strongly 36.81273791193962 7.706361153174744 0.016702693969933815
9 2018 GB UK Don't know 9.172458708286298 3.7193250038585646 0.004161732580794294
9 2018 IT Italy Agree strongly 901.7972207665442 30.586577203163642 0.32852357537076715
9 2018 IT Italy Agree 1430.7424559295177 38.38320766561093 0.5212176487494395
9 2018 IT Italy Neither agree nor disagree 280.6914756894112 16.77627904338445 0.10225554597650983
9 2018 IT Italy Disagree 71.88637584447862 8.362538849972736 0.02618811487664657
9 2018 IT Italy Disagree strongly 15.87629038095476 4.008305455792804 0.005783712301910074
9 2018 IT Italy Refusal 44.006200790405266 6.791706130128767 0.016031402724726786
9 2018 NL Netherlands Agree strongly 262.21094840765 16.544213321359592 0.1567309898538355
9 2018 NL Netherlands Agree 767.6583309769632 28.499902045924415 0.45885135923657905
9 2018 NL Netherlands Neither agree nor disagree 282.25639760494226 17.237608609494938 0.16871272865549694
9 2018 NL Netherlands Disagree 293.99395042657846 17.449722240581725 0.17572859997348897
9 2018 NL Netherlands Disagree strongly 38.73613214492796 6.451608110412703 0.023153695034674644
9 2018 NL Netherlands Don't know 28.144255638122555 5.5794030022528505 0.01682262724592489
9 2018 NO Norway Agree strongly 326.7222597599029 19.617878217588924 0.23237714055575773
9 2018 NO Norway Agree 629.7949816584586 26.88512631869136 0.4479338416724533
9 2018 NO Norway Neither agree nor disagree 301.22150850296015 19.34609217569541 0.2142400486310549
9 2018 NO Norway Disagree 117.66496586799619 11.181674382016611 0.08368774240264183
9 2018 NO Norway Disagree strongly 20.534094810485836 5.004135435801671 0.014604619346928029
9 2018 NO Norway Don't know 10.062189996242523 4.055058854781057 0.007156607391164192
# ################################################################## #
# Trendlines with 'open' datapoints: support for government measures #
# against income differences, using ESS 2002-2018 data #
# ################################################################## #
library(readr)
library(here)
library(dplyr)
library(ggplot2)
library(hrbrthemes)
library(ggtext)
library(ggrepel)
# read CSV-file with survey-weighted responses for selected countries
d_essw1w9_incomediff_w <- read_csv(
file = here::here('d_ess_w1w9_gincdif_w_subset.csv'),
col_types = cols(
essround = col_factor(),
essround_year = col_factor(),
country_iso2c = col_character(),
country_name_en = col_character(),
gincdif = col_character(),
n = col_double(),
n_se = col_double(),
pct = col_double() ))
d_essw1w9_incomediff_w <- d_essw1w9_incomediff_w %>%
# sum the two agree-categories by country
filter(gincdif %in% c('Agree strongly', 'Agree')) %>%
select(-gincdif) %>%
group_by(essround_year, country_name_en) %>%
tally(pct, name = 'pct_agree') %>%
# create a label combining country name + rounded percentage agreeing
mutate(
country_label = if_else(
essround_year == '2018',
paste(country_name_en,
as.character(scales::percent(pct_agree, accuracy = 1))), NA_character_))
# From https://stackoverflow.com/a/52251548/125085 :
# To obtain an "open point", you need a plot symbol with a
# separate definable fill and stroke =>
# You can check what these are with example("points")
# and going to the 3rd plot."
p_essw1w9_incomediff_w <- d_essw1w9_incomediff_w %>%
ggplot(aes(x = essround_year, y = pct_agree,
group = country_name_en, color = country_name_en,
label = country_label)) + # specify label for geom_label_repel()
geom_line() +
geom_point(
# leaving color unspecified here uses the color specified in aes() above,
# so it will be the same as the line color.
size = 2.0, # select an appropriate size for the point
shape = 21, # required: select a plot symbol with a separate fill and stroke
stroke = 0.5, # specify a narrow stroke around the point
fill = "white") + # fill the point with white / "leave open"
geom_label_repel(
size = 4,
nudge_x = 0, xlim = 9.2, # tweak horizontal positioning
segment.colour = 'grey80', # connect point and label with grey line
na.rm = TRUE, # ignore all points with no label, i.e. only label last point 2018
direction = 'both') + # labels can move horizontal & vertically
scale_x_discrete(
limits = c('2002', '2004', '2006', '2008', '2010',
'2012', '2014', '2016', '2018',
'2020', '2022'), # manually specify to increase plot range past 2018
breaks = c('2002', '2008', '2014', '2018')) + # only label selected years on x-axis
scale_y_continuous(labels = scales::percent_format(accuracy = 1)) +
theme_ipsum_rc() + # select theme (hrbrthemes)
theme(
# remove vertical grid lines
panel.grid.major.x = element_blank(), panel.grid.minor.x = element_blank(),
legend.position = "none",
plot.subtitle = element_markdown()) + # enable markdown for subtitle italics (ggtext)
labs(x = NULL, y = NULL,
title = 'Support for government action against income inequality is increasing',
subtitle = 'Percentage of respondents that (strongly) agrees with the statement "*The government should take<br>measures to reduce differences in income levels*", 2002 – 2018".',
caption = 'Data: European Social Survey, wave 1 – wave 9, n = 116.444 • Maarten Hermans (@hermansm).')
ggsave(here::here('p_trendline_open_point_ess_incdiff_2002_2018_en.png'),
p_essw1w9_incomediff_w, width = 8, height = 6)
rm(d_essw1w9_incomediff_w, p_essw1w9_incomediff_w)
@mhermans
Copy link
Author

mhermans commented Jan 7, 2022

p_trendline_open_point_ess_incdiff_2002_2018_en

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment