Thursday, October 27, 2016

Edmonton City Council Gender Equality

In the 2013 civic election, 79 candidates ran for mayor and city council, 17 of which were women. The election resulted in one woman getting elected out of a council of 13. Though women represent 51% of the city's population, they represented only 22% of candidates, and resulted in 8% of council seats. With results like this, it's little surprise that groups like Equal Voice are calling for improvements to our system, including encouraging a larger diversity of candidates and promoting a more balanced and representative city government.

Taking a deeper look at these results shows some interesting trends though. For instance, in 5 wards in 2013, there were no women running at all, and half of all female candidates were clustered in races in two highly contested wards. This suggests that, while 22% of all candidates were female, the distribution of female candidates may have already been predisposed to a lower number of female winners in the end. Let's take a look.

There were 12 wards and one mayoral race in 2013 for city council, and the proportion of female candidates per race ranged from 0-43%. Assuming any given candidate has an equal chance of winning any given race (an assumption we'll check later), this is the expected distribution of female winners:

As previously mentioned, there was absolutely no chance of there being anywhere from 9-13 women on council, as 5 races were contested solely by men. Based on the uneven distribution of candidates in the remaining races, there was an expected 2.01 female councillors last year, or 15% of council. So while the number of women on council was still less than expected, it was closer than what we might have expected based on the total number of female candidates. Instead of being 14% lower than what we might expect from candidate distribution, we were 8% lower.

So does this mean that female candidates are 8% less likely to get elected than male candidates? That's really hard to say, and it turns out we don't have enough data yet. One way we can check is by looking at the p-value of our outcome - what's the chance that we could have gotten something as bad as the result we did, assuming our null hypothesis (that women are as likely to get elected as men) is true? In this case, the p-value is 0.37. Essentially, our data set is small enough that any result between 0-4 female councillors wouldn't have been all that much of a surprise (and in fact, 6-7 would have been an indication of an opposite effect). So let's not worry about significance yet, and instead look at more elections!

Edmonton's civic elections elect people to mayor, council, and public and catholic school boards. If we do the same analysis for all three councils for the last four elections, we get a chart that looks like this:

This suggests a lot of things, including:

  • City Council results over the last 4 elections haven't shown more than a 10% deviation one way or another. More importantly, the p-values for each election have been totally reasonable.
  • There's a lot of variation in the Public School Board elections. This is partially explainable based on how small the Board is, so any variation will be magnified from a percentage basis. On the other hand, that level of variation isn't present in the (smaller) Catholic Board...
  • Catholic School Board elections haven't shown an anti-woman bias in this data set.
So, interestingly enough, of the 12 discrete votes that I looked at, 4 had a slight anti-woman bias, and 8 were perhaps slightly pro-women. Essentially, what this suggests is that female candidates are just as likely to get elected as male candidates. If we add up all the results since 2014 into one graph (of 402 candidates running for 114* positions over the last four years), we get the following distribution:

Overall, 46 women have been elected to 114* electable seats, where the candidate distribution and chance would expect us to have elected 42.5. The p-value assuming an equal electability between women and men is 0.22, so no, meninists, there isn't a pro-woman bias either. These results are pretty much what we'd expect given the candidate distribution we've had. This general conclusion holds true across city council (p=0.29):

And Public Schools (p=0.19):

Though intriguingly enough breaks down at Catholic Schools* (p=0.03):

*: Here it's worth mentioning that before 2010, the Catholic election system was really weird and had a wildcard winner from whoever had the most votes but wasn't elected in their ward. This was particularly silly seeing as not all wards were the same size, so I've ignored the wildcard seat and victor for the purposes of this analysis.
The fortunate summary of all of this is that there's no evidence that any system is rigged against female candidates. That being said, the proportion of women elected to civic office in the last years is just under a third of total offices filled, which isn't even remotely balanced. The best way to get a more representative council is to have more under-represented demographics put forward their candidacy, so if you know anyone who might be interested or qualified (of whichever underrepresented group you choose), I strongly encourage you to encourage them to run.

Wednesday, August 17, 2016

Edmonton Bike Safety

Bicycles in Edmonton have been in the news quite a bit recently, particularly given the success of new bicycle development in Calgary. Bicycle lanes in Edmonton have been proposed, installed, removed, illegally painted, removed again, and blocked in council quite a bit in the last few years. Frustrations between cyclists, city planners, and drivers have gotten to a boiling point recently, and I think it's safe to say that whichever side of the debate you're on you're likely sick of it all. But please keep reading!

With all that said, things have recently gotten a bit more interesting from a data point of view. A month ago I was made aware of a data set of cycling injuries and incidents from 2009-2014 from the nice folks at Spacing Edmonton, which were analyzed by them as well as (more recently) the group over at Slow Streets.

Specifically, the people at Slow Streets made the claim that injury hot spots indicate where more cyclists are travelling, showing cyclist 'desire lines' which would be prime targets for bicycle infrastructure. However, a quick look at the map suggests that the streets with supposedly lots of bicycle traffic are also the roads with lots of vehicle traffic. Hypothetically, even if all streets had the same bicycle traffic, we might expect a similar distribution since one might think that more cars might lead to more interactions with cars.

So let's take a look and check this hypothesis. Fortunately, Edmonton has a nice map of average annual weekday traffic for major roadways. I combined the map data of all 1,070 cyclist injuries from 2009-2014 with the map of all streets that had traffic volume stats, and ended up with this result:

Error bars represent the 95% confidence interval for injury rate.

It looks as though there is a decisive link between vehicular traffic on a road and the number of cyclist injuries. As the city doesn't seem to have any specific information on bicycle ride distributions, it's hard to say with any certainty if the Slow Streets analysis is correct. Either way, it's clear that wherever cyclists mix with lots of cars, we get lots of injuries. This analysis ended up looking at 571 km of major roads with traffic data, which were responsible for 760 of the injuries recorded from 2009-2014.

But hey, that's not all! Edmonton also has a map of everyone's favorite (or least favorite) things - bike lanes!

From the map, Edmonton's road bike-friendliness can be broken down into four different types. There are separated shared use pathways, painted on-road bike lanes, signed on-road bike lanes, and plain old normal streets. So what does my previous analysis look like if we split road types up by their bicycle infrastructure? Why, this:

Again, error bars are the 95% confidence interval. Basically, ignore the green bars...

What are some takeaways from this? Well, first of all, major roads very infrequently have signed on-road bike lanes, so there's far too much variability for a proper analysis of them (green on the graph). Far more common are roads with separated shared bike paths (red), or no infrastructure at all (grey). From this, we get the firm (and hopefully not unreasonable at all) conclusion that biking on separated, wide, shared pathways for bikes is safer than biking on a normal road with traffic, by a factor of about 2.

From the City of Edmonton bike map

However, an interesting conclusion from this is that it's extremely hard to make the argument that painted bike lanes are safer than normal roads. In fact, in some cases, it looks quite a bit safer to bike on non-bike-laned roads. Weird.

What might cause this? Well, first of all I'd say that this analysis is a few factors short of anything scientific. For instance, the bike lane map for Edmonton likely includes lanes and paths that haven't existed for the entirety of 2009-2014, or have since been removed, so some of the injuries from my analysis are likely classified inaccurately. As well, other researchers, when investigating bike lane safety, controlled for the presence of parked cars on the side of the road, which I did not. So while I wouldn't necessarily go so far as to say that my analysis shows Edmonton bike lanes are more dangerous than streets without bike lanes, I stand by the assertion that bike lanes aren't safer than streets without them. I embrace the subtlety of that distinction.

Regardless, the data is quite clear about the effects of vehicle traffic on bike incidents, and the effects of physically separating bike paths from roads. Namely, separating vehicle and bicycle traffic may reduce bicycle injuries by a factor of 2 on busy roads, and up to a factor of 6 on quieter roads.

Again this is not surprising at all - I can't stress just how intuitive and likely boring the main finding here is. But this data set of cycling injuries from 2009-2014 does seem to show that painted bike lanes have not had the effect that was perhaps intended.

In my opinion, having decent bicycle infrastructure is absolutely important to having a vibrant and healthy city. Hopefully future bike lane decisions are made keeping injury prevention and statistics in mind, in such a way that we can expand our biking infrastructure as effectively as possible.

Sunday, July 3, 2016

Edmonton City Council Votes (Part 2)

A year ago I did a short piece looking at Edmonton city council voting patterns. It was pretty fun and showed some cool blocks in city council, but since then we've had a monster by-election, so it seemed like now is a good time to take a second look at this analysis.

Since council as a whole got elected in 2013, there have been 5763 votes performed, according to the city's Open Data catalogue. Of course, many of these are procedural matters, and the vast majority of them are unanimous. If we restrict the votes to non-unanimous votes to see how the councillors interact, we're actually only left with 358 votes to look at.

Of those 358 votes, we can come up with this result, showing how often each member of council agreed with each other member of council. I've colour-coded it to make the numbers seem a little less daunting:

The major update here, of course, is the addition of Councillor Banga to the mix. He seems to generally follow the Iveson/Esslinger/Walters group that we identified last year, though generally less so than his predecessor Amarjeet Sohi did. He also seems to disagree with Councillor Caterina disproportionately relative to anyone else. Again, much like a year ago, Councillor Nickel is a bit of an outsider, who agrees with his colleagues far less than anyone else does.

Another way of looking at this is to make network graphs. This first one shows all connections with councillors that agree with each other at least 67% of the time (this number was chosen so that Councillor Nickel isn't left out). Feel free to play with it, it's rather fun!

Alternatively, we can generate a network graph based on who agrees with who the most frequently. Orange arrows (when you hover over them) indicate the most frequent agreements for each councillor, blue arrows indicate that another councillor most frequently agrees with the first, but that it isn't reciprocated.

This shows a bit more clearly how potential groupings look at city council. Five councillors agree with Mayor Iveson more than anyone else, and two other councillors most frequently agree with two of those five. On the other hand, the remaining 5 other councillors tend to spread out from Councillor Caterina.

Of course, these two groups aren't all that different - Councillor Caterina and Mayor Iveson still vote the same on 75% of contested motions, so realistically they agree 98% of the time on all motions, but the above network graph is a nice way to dramatize it!

Finally, we can also take a look at how often each member of council ends up getting the result they voted for on each motion. Again, only looking at non-unanimous votes, we have:

Impressively, Mayor Iveson ends up on the winning side of a council vote 95% of the time. In fact, of all 5763 votes performed since 2013, Mayor Iveson has only been disappointed 17 times. There are certainly many conclusions that can be drawn from that, but at the very least nobody can say that Don Iveson has difficulties instituting the agenda he wants on council.

So there you go. I plan to do another analysis like this before the next election, so stay tuned for that one!

Tuesday, April 26, 2016

Which Edmonton City Councillor are You?

Since the Ward 12 by-election just a few months ago, Edmonton city council has gotten into quite a few rather contentious votes. Most recently the Mezzo Building decision left quite a few observers rather upset, but earlier council decided to scrap the proposed Hawrelak Park Water Play Feature (worst name ever, by the way) after being faced with price increases, and has had to face some struggles with the proposed green development in the Blatchford area.

With that all being said, since Councillor Banga has taken on the role, Edmonton's open data suggests that there have been 25 votes of council that have been non-unanimous, which it turns out is more than enough that no two councillors have voted the same way on everything over the last two months (even though Councillor Oshry and Mayor Iveson gave it their best shot at 24/25). That means that, with only a few questions, we can generate a choose-your-own-adventure game in the style of a Buzzfeed quiz to see which councillor you agree the most with over the last term!

Which Edmonton City councillor are you? The answer will surprise you!

Friday, April 22, 2016

Edmonton Zone Map

Earlier this week, there was a bit of a kerfuffle raised at City Council when they contentiously passed a motion to allow a new 16-storey building near Whyte Avenue. In order to allow the new building, they had to change some of the zoning around the area.

I was curious about exactly what the distribution of zones in Edmonton look like, so I decided to see if I could find a map. Oddly enough, despite the data being available on the city's OpenData portal, there wasn't a readily-available one to be found via Google.

And maybe there's a good reason - it turns out there are over 85 different zone descriptors that the city uses, and many of the individually set zones are actually rather tiny (small parks count as their own zone, for instance). If you coloured a map based on all the different types of zones, it would be a scary kaleidoscope that wouldn't be terribly useful.

So instead, I've reverted to the tried and true Sim City method and labelled things broadly as either Residential, Commercial, or Industrial zones. Take a look:

If you've lived in Edmonton for more than a couple minutes, I'm sure that this map isn't surprising to you at all. I find it still cool to actually see things laid out like this though - it really shows you the industrial moat that surrounds Mill Woods, for instance, and specifically locates all of the strip malls we seem so fond of. (If your favorite strip mall isn't coded blue, it's most likely because many areas tend to end up as 'Site Specific Development Control Provision', which is essentially bylaw code for 'none of the above'. I didn't end up colour coding them all because there 650 of them, mostly all for different reasons...)

One final thought: I'm not so sure I like the sounds of the Anthony Henday being an agricultural zone. Hopefully they keep the agriculture and the four lanes of speeding gas guzzlers a little separated...

Tuesday, March 8, 2016

Gender Equality in APEGA

Pop quiz: Given that recent data suggests that women earn 72% of what men do for similar work in Canada, what is the wage gap for women in engineering in Alberta?

  • A) 13%
  • B) 0.15%
  • C) The math depends on your agenda

You're right! The math behind the wage gap depends on what you're looking to achieve in your analysis. Congratulations!

Let me explain. For the last couple of years, APEGA has published a detailed salary survey of its members. (This year, APEGA instead published an 8-page summary of the survey, and asked $1,900 to share the full information with you, while also withholding the complete data from previous years. Yuck.) Fortunately, through the power of the web archive, we can access the previous salary survey data, which is helpfully broken down into many demographics. Let's take a look.

From the 2014 salary survey, the average male engineer's salary was $125,721, and the average female engineer's salary was $109,402, for a wage gap of 13%. Alright, we're done here. That was easy.

Well, maybe not so fast. One of the biggest determinants of salary is seniority, and if seniority isn't distributed similarly between genders then that may skew the data. If we compare male to female earnings based on seniority, we get:

For salary survey purposes, an A- class would be the equivalent of a co-op student, and an F+ class would be senior management.

When we look at the data like this, we see that until maybe the very top levels of senior management, male and female engineers make approximately the same salaries (within 2% one way or another). If we weight this based on the total number of engineers in each category, we actually end up with females earning 0.15% more than men on average.

So on the one hand we have women earning the same as men, and on the other hand we have women making 13% less, all depending on how you look at the statistics. While things are looking good from the point of view of co-workers getting paid similarly for similar responsibilities, is there a chance that something else may be pulling back on womens' chances at the better paying jobs? We can investigate further by looking at seniority by gender:

Alright now that's something. Women tend to average around a B to a C level, whereas men tend to average around a C to a D level. Here's a major difference, and when compared with the salary averages at each seniority level, we can see where the previously-established 13% salary difference comes from.

Based on the earlier analysis, I'm pretty optimistic that for the same responsibility level, male and female engineers make approximately the same wages. But it's definitely worth looking into what's causing the differences in distribution of work responsibilities.

Starting out, I think there are three major plausible theories. A pessimistic and sexist theory could be that men are promoted faster in the workplace, and as a result tend to sit higher in seniority (glass ceiling style). The disappointing yet potentially less sexist theory is that women, for one reason or another, leave the workplace earlier than men, and as a result there are fewer of them to take on senior management roles. And the last theory is that changes in the graduation rates of female engineers are leaving women just now catching up to men in equality.

Let's examine each in turn. Each level of seniority in the APEGA salary survey also contained information on length of career post-graduation, for women and for men. If the distribution of these values doesn't line up, perhaps that tells us something. The three largest groups by seniority are B, C, and D:

Well that's bang on, how about:

Still pretty close. Then there's:

Alright, they actually all look reasonably similar. If anything, there may be a higher percentage of younger women in D-level positions than men, similar to the higher percentage of very young men in C-level positions than women. Nothing that could quite explain a 13% wage disparity though.

The second theory I suggested was that women may leave the workplace at younger ages than men, for various reasons. Here's the distribution of women at different stages in engineers' careers:

Yikes. Please note though that the salary data for people who've worked 35-40 years is pretty slim, so it's not terribly unlikely that there actually are some women engineers in that demographic, and the 2014 salary survey actually over-polled the number of females which may also skew the data. Either way, we see a clear trend where older and more senior engineers are substantially less likely to be female than younger engineers.

The final piece of the puzzle comes from the third theory I listed above. Graduation rates for female engineers have changed wildly over the last 40 years, as shown in this graph from the Ontario Network of Women in Engineering:

For a wide variety of reasons, the proportion of engineers graduating in 1975 who were female was only 3.6%. This climbed to approximately 20% only in the late 1990s, where it has fluctuated a bit since then. The last graph I present to you is the comparison of graduated female engineers since graduation and the percentage of female engineers in APEGA over the same time range:

While there may be a bit of a discrepancy between Canada graduation numbers and Alberta employment numbers, I think this comparison is still valid.

So what are we left with to explain the wage gap for engineers in Alberta? It appears as though a significant part of it may be due to the fact that, until relatively recently, the rate of women entering engineering education was dreadfully low. A lot of the high-paying senior management positions that are held by men simply don't have many women counterparts to be offered to, leading to an imbalance in seniority. That being said, women in engineering, certainly past the 20-years-since-graduation mark, are still lagging behind their graduation rates, suggesting that women who did graduate over 20 years ago were still more likely to leave the field than their male counterparts.

Where does this leave us? Well, while things are definitely getting better, and engineering is surprisingly better than the average of other workplaces, there's always work to be done. I suspect that as the workforce ages, we'll see a narrowing of the disparity in seniority, and hopefully in the meantime we can figure out which factors lead to women leaving the field disproportionately. Only when we reach a situation where opportunities at all levels of engineering employment are equal will we have a truly equal environment for engineers in Alberta.

Edit: It's worth noting that the APEGA salary survey does not distinguish between full time and part time, or contract or non-contract work. As a result, any potential gender disparities between these forms of employment haven't been assessed in this post, or in the APEGA salary survey as a source.

Tuesday, March 1, 2016

Edmonton 2015 Federal Election Results

As you might remember, that big old scary 2015 Federal Election happened way back in October. However, the Government only released the official results of the election just yesterday - go take a look at them, they're quite cool!

In the meantime, here's the final official map of how each poll in Edmonton voted, in a similar format to my post regarding the previous Alberta election. Each poll is coloured by which party had the most votes there (red is Liberal, blue conservative, and orange NDP), and then darker colours indicate the party had greater than 50% support.


Wednesday, February 24, 2016

Edmonton Ward 12 By-Election Results

Edmonton's Ward 12 by-election took place this week, and it had a historic 32 candidates running to sit on council. There were a couple of fun outcomes from this election that are worth taking a quick look at:

Winning Vote Total

I didn't bother doing a full write-up on this, but I was curious at the beginning of the race about just how many votes it would require to win this election. With 32 candidates, technically the winner could have won with 3.125% +1 votes, which is terribly low, but I had a hunch that there would be a few front runners, and lots of trailing candidates. I decided to take a look at historical civic elections in Edmonton and Calgary, and posted this graph on twitter:

Obviously it was a long shot extrapolation, as very few past elections have had even half the number of candidates as this one.

How well did I do? The winner, Moe Banga, got 17.76% of the vote, which adjusts our graph to this:

I'd say that looks pretty decent. Sure, it was a long shot estimate, but it was certainly a lot less dire than the worst-case guess would have been.

Vote Distribution

Sadly, because of its by-election status, there were only seven polling stations in this election, which means that mapping voting data is a bit silly. Here are the results of the winner in each poll anyway, though.

Again, not much to write home about. This map is a lot more boring than it could have been largely because all the vote totals tend to be quite close together, and each poll represents several neighborhoods. 7 data points just isn't enough to have fun with.

That being said, we can see that Moe Banga had fairly wide-ranging support, which will be encouraging for him going into council. Irfan Chaudhry, who came in fourth, had a narrow lead in Charlesworth, Walker, and Ellerslie neighborhoods, and Laura Thibert, who came in second, had a decent lead in Larkspur and Wild Rose.

Election Strategies

Finally, when we look at the total vote breakdown a little more closely, we can get a bit of an idea as to how some of the campaigns prioritized.

Take advance voting, for example. Advanced votes accounted for 27.3% of all votes cast, but were prioritized by some candidates more than others. Moe Banga, the winner, was clearly quite organized and got 37% of his vote in advance (these advance votes of his were enough to beat the total votes of 26 other candidates even). Other high-ranking candidates, like Balraj Manhas, Arundeep Sandhu, Yash Sharma, and Rakesh Patel all got over 35% of their vote in a similar way. Candidate Sam Jhajj was a clear outlier though - getting 70.3% of his votes from advance voting.

And finally, special ballots only accounted for 1.1% of all ballots, and are reserved for people who can't vote in either advanced or normal ballots. Strangely enough, three candidates (Moe Banga, Rakesh Patel, and Balrash Manhas) combined had more than half of these votes. Kudos for grabbing the out-of-towners, I suppose!

That's it! And we won't have another election in Edmonton for 18 months! See you after the next one.

Tuesday, January 26, 2016

Taxi Stats for Edmonton

The fight in Edmonton for Uber vs Taxis has finally reached its head today, with the final vote for the  updated Vehicle for Hire bylaw to be debated by the end of the day (barring any disruptions to council).

Potentially complicating matters is that this takes place during the very beginning of the Ward 12 by-election, meaning one seat on council is vacant. This is perhaps extra complicating matters as some of the candidates for the by-election are either directly involved with the United Cabbies Association of Edmonton or calling for a postponement of the debate, under the understanding that Ward 12 contains a disproportionate number of taxi drivers relative to other wards of the city.

Of course, taxi drivers are only one half of the equation, and taxi users are also important to consider. While the stat on the previous link that 35% of cabbies live in Ward 12 is only sourced to the Nav Kaur campaign, there is plenty of other information from the cab users from a 2014 city survey that reveals some data from the consumer side of things. This first map, for instance, indicates the percentage of people who regularly take taxis in each ward*:

Green: higher taxi usage; Red: lower taxi usage
*Postal codes T5C, T5S, and T6P had low survey turnout and probably should be disregarded in this map.

As may be expected, taxis are more commonly used in the interior of the city, and less commonly used to the west and east. Councillors who might be more concerned than average about their constituents' access to taxis could include McKeen (ward 6), Henderson, (ward 8), Walters (ward 10) and Nickel (ward 11).

The survey also looked at the perceived importance and satisfaction for taxis in Edmonton. Both questions were rated from 1-5, with five being the most positive (extremely important and very satisfied, respectively). The averages for each ward are:


Green: High importance; Red: Low importance


Green: High satisfaction; Red: low satisfaction

 On average, Edmonton citizens tend to view taxi services as somewhere between moderately and very important (3.86/5), and are somewhere between somewhat dissatisfied and neutral about their experiences (2.79/5).

This post is mostly not to provide opinions, but to share some of the data that the city has on taxi users in Edmonton. There are parts of the city where people regularly take taxis and think they are important, but also aren't satisfied with the service they receive, and regardless of the outcome of today's vote hopefully opening up the discussion around taxi alternatives results in a better user experience overall.