Exploring the moral landscape with recursive partitioning

I’ve mentioned the World Values Survey before. Lately, I’ve been taking another look at this fascinating dataset, specifically at the questions on morality. The chart below provides an analysis of responses to the question “Is abortion justifiable?” These responses ranged from 1 (“never justifiable”) to 10 (“always justifiable”). I looked at the most recent data for Australia and the United States, plus one European country (the Netherlands) and one African country (Zambia), using recursive partitioning with the rpart package of R, together with my own tree-drawing code.

Attitude data such as this is often explained using political orientation, but political orientation is itself really more of an effect than a cause. Instead, I used age, sex, marital status, education level, language spoken at home, number of children, and religion as explanatory variables, with some grouping of my own. Demographic weightings were those provided in the dataset.

For the United States (US), the overall average response was 4.8 (as at 2011, having risen from 4.0 in 1995). However, among more religious people, who attended religious services at least weekly, the average response was lower. This group was mostly, but not entirely, Christian, and the area of the box on the chart gives an approximate indication of the group’s size (according to Pew Forum, this group has been slowly shrinking in size, down to 36% in 2014). The average response was 3.0 for those in the group who also engaged in daily prayer, and 4.3 for those who did not. Among those who attended religious services less than weekly, the responses varied by education level. The average response was 4.8 for those with education up to high school; 6.9 for those with at least some tertiary education who were Buddhist (B), Hindu (H), Jewish (J), Muslim (M), or “None” (N); and 5.4 for those with at least some tertiary education who were Catholic (C), Orthodox (Or), Protestant (P), or Other (Ot).

For Australia (AU), the overall average response was 5.8 (as at 2012, having risen from 4.3 in 1981), with a pattern broadly similar to the US. Here the “more religious” category included those attending religious services at least monthly (but it was still smaller a smaller group than in the US). The average response was 2.7 for those in the group who also engaged in daily prayer, and 4.6 for those who did not. The group most supportive of abortion were those attending religious services less than monthly, with at least some tertiary education, and speaking English or a European language at home. Those speaking Non-European languages at home clustered with the religious group (and those with at least some tertiary education speaking Non-European languages at home are a growing segment of the population, increasing from 6.2% of adults in the 2011 Census to 8.3% of adults in the 2016 Census).

For the Netherlands (NL), the overall average response was 6.5 (as at 2012). Those most opposed to abortion either attended religious services at least weekly (3.2), or were Hindu or Muslim (3.3). Then came those who either attended religious services monthly (5.2), or who attended religious services less often, but were still Catholic (C), Orthodox (Or), Protestant (P), or Other (Ot), and had not completed high school (5.3). The group most supportive of abortion were those attending religious services less than monthly, with at least some tertiary education, and who were Buddhist, Jewish, or “None” (7.9).

For Zambia (ZM), opposition to abortion was strong, with an overall average response of 3.2 (as at 2007). It was highest for those whose marital status was “separated” (4.5), and lowest for those aged 28 and up whose marital status was anything else (2.8).

Of the explanatory variables I used, all except sex, age, and number of children were important in at least one country. However, sex was important for “Is prostitution justifiable?” or “Is violence against other people justifiable?” Age was important for “Is homosexuality justifiable?” or “Is sex before marriage justifiable?” Number of children was important for “Is divorce justifiable?” or “Is suicide justifiable?” For example, here is an analysis of attitudes to divorce:


Advertisements

American Solar Challenge 2018: The run to Burns

I recently got my hands on the GPS tracker data for the American Solar Challenge last July. Above (for the 6 Challengers completing the stage) and below (for the Cruisers) are distance/speed charts for the run from Craters of the Moon to Burns, which seems the stage of the route with the best data (at this time of year I haven’t the time for a more detailed analysis). Click on the charts to zoom. Small coloured circles show end-of-day stops.

Stage times were 15:Western Sydney 8:05:16, 101:ETS Quebec 8:20:13, 2:Michigan 8:25:08, 55:Poly Montréal 8:42:52, 4:MIT 9:07:58, and 6:CalSol 9:30:12 for Challengers, and 828:App State 10:22:37, 559:Bologna 12:13:57, and 24:Waterloo 15:29:12 for Cruisers (note that Bologna was running fully loaded on solar power only, while the other Cruisers recharged from the grid).

The data has been processed by IOSiX. I’m not sure what that involved, but I’ve taken the data as gospel, eliminating any datapoints out of hours, off the route, or with PDOP more than 10. Notice that there are a few tracker “black spots,” and that trackers in some cars work better than in others. The small elevation charts are taken from the GPS tracker data, so they will not be reliable in the “black spots” (in particular, the big hill before Burns has been truncated – compare my timing chart).


Voting patterns in the United States

Because of my interest in social statistics, I’ve been exploring county-level results from the US 2016 presidential election. The map below (click to zoom) summarises the results (blue for Democrat and red for Republican, coloured according to how strongly counties voted one way or the other). Nine of the more extreme counties are highlighted.

Most of the variance in this data can be explained by demographic factors such as race, age, education levels, local unemployment, rural-urban continuum code, and median household income. The latter is particularly interesting, and the chart below provides a summary.

On a scale from −0.5 being 100% Republican to +0.5 being 100% Democrat, the curve shows the average vote of counties by 2016 median household income (where the averages are weighted by county population sizes, and LOESS smoothing is used to draw the curve). Overlaid on the diagram is a bar chart for the total population of different median household income groups (the scale for this bar chart is on the right).

It can be seen that, at the very poorest end, votes are balanced between Democrat and Republican. For example, here are the 7 poorest counties in the United States, by median household income. They are all rural:

Above that bottom end, votes trend Republican, with the peak Republican vote occurring at median household incomes around $40,000. Above about $56,000, counties swing Democrat, and the Democrat vote increases with increasing wealth. For example, here are the 4 richest counties in the United States, by median household income. They are all part of the Baltimore–Washington metropolitan area:

Essentially, the Republican Party seems to have become the party of the poor, particularly the rural poor. Indeed, the (population-weighted) median of 2016 median household incomes for Democrat-majority counties was $61,042; while for Republican-majority counties it was $52,490 ($8,552 less). For a visual perspective, the map below limits the previous one to counties with a 2016 median household income below $56,000. It is precisely because the Republican Party has become the party of the rural poor that these maps are mostly red. I had not fully appreciated this before analysing the data (although others have), but it certainly explains much of recent politics in the US. However, predicting the results of the next presidential election would require some solid demographically linked polling data as well as a good voter turnout model.


Sea levels in the Pacific

I recently visited Port Vila, capital of the Pacific island nation of Vanuatu (the photo above is from the Port Vila waterfront). Port Vila is the site of a sea-level measuring station. It is interesting that, although local newspapers are deeply concerned about sea level rise, the average sea level rise between 1993 and 2017 at Port Vila was essentially zero (see chart below, which uses LOESS smoothing of monthly measurements).

How can this be? Aren’t global sea levels rising at 2–3 mm per year? Well, “global sea level” is a rather theoretical concept. Ocean temperatures are not uniform. Some islands are rising out of the ocean. Others are sinking. Air pressure, and the El Niño Southern Oscillation cycle, have a huge effect on sea levels too. As they say, it’s complicated.

The NASA map below shows that some areas of the Pacific have actually seen a long-term reduction in sea level (independent of any upward or downward movement of land). Other areas, of course, have seen quite rapid increases (the increases and decreases average out to a rise of about 3 mm per year). The map covers data only up to 2008, however. Since 2008 was roughly the peak for the Port Vila data, it doesn’t quite explain the last decade of the graph above. If I had to guess, I’d assume that some of those sea-level-decrease areas on the map had shifted a bit.


Support for Kavanaugh vs support for Trump

Brett Kavanaugh has been in the news rather a lot lately. The chart above shows support for his appointment to the US Supreme Court, for various demographic groups, as per a 1 October Quinnipiac University Poll. This is compared to the 2016 Trump vote for those same groups, as per CNN exit polls (in both cases, some missing information had to be inferred using the data provided plus census data). The area of the circles shows the size of the various groups.

Responses to Kavanaugh seemed largely to follow partisan lines. Democrats mostly went one way, Republicans the other. However, white women seemed to support Kavanaugh less than expected, perhaps because they were more likely to believe the accusations made against him. Minority groups, on the other hand, were more supportive of Kavanaugh than of Trump, perhaps because of concerns about evidence, corroboration, and due process. Overall, it seems to almost balance out, though – I must say that I can’t see any support here for a “blue wave” at the November elections.


Would y’all like to see a map?

The word y’all is used as a second person plural pronoun in the United States (although in my travels I have also heard it used as a polite singular). The map above (click to zoom) shows the average frequency of use by state, according to the 2003 Harvard Dialect Survey. The usage is primarily Southern.

English needs a second person plural pronoun, it seems to me. What do all-y’all think?

Image produced using the maps package of R. Other visualisations of the survey exist.


A Day in the Life of Solar Energy Racers

By special request, here is another day in the life post, this time for Swiss solar car team Solar Energy Racers (SER). The day is 29 September, the last day of the Sasol Solar Challenge. I am relying on information from a blog by SER strategy person Georg Russ, together with GPS data screen-scraped off the race tracker by a friend, and elevation data from the Shuttle Radar Topography Mission. As before, the horizontal axis of the chart represents distance.

The day began at Swellendam, and the team drove to the control stop at Bredasdorp, stopping there for 30 minutes the first time (it can be seen from the chart that SER was not quite so good as Nuon at maintaining a consistent speed). The team drove two loops, the first of them to Cape Agulhas (the southernmost point of the African continent, and the site of a picturesque lighthouse). It can be seen from the chart that they had to stop on the way (to repair a loose left rear wheel fairing – with duct tape, of course).

The team completed one more, shorter, loop, before heading on to the finish at Stellenbosch (Nuon drove that shorter loop three times). Knowing when to quit driving loops was an important strategy decision. The chart highlights the hilly nature of that final leg (going through part of the Cape Fold Belt), as well as some stops to change drivers.

Georg Russ notes an energy output for the day of 5.35 kWh (with 0.64 kWh recovered), and a photovoltaic input of 4.63 kWh, giving a net battery drain of 0.08 kWh. Pretty good!