# Arithmetic of gender equality in Germany’s federal parliament

In an interview last week, Minister of Justice and Consumer Protection Katarina Barley expressed concern about the declining share of wmomen in the Germany's current federal parliament (see e.g. here). That share decreased from 36 percent to 30 percent after the most recent election. Barley suggests that this could imply “a step backwards in gender equality.”

I am skeptical, though. The figure below shows that no party in the current parliament reduced the share of women by 6 percentage points or more (which would be required to reduce the average share over all parties by 6 percentage points).

Instead, part of the decline seems to be explained by a compositional effect: Parties with a women's share below 36 percent won seats relative to parties with women's share above 36 percent. This is especially true for the FDP and the AfD that weren't in the previous parliament but also for the SPD that had a women's share of about 44 percent in the previous parliament but that also suffered losses in the most recent election. The vote share decline for the CDU-CSU (which, holding everything else equal, helps the women's share in parliament) is not enough to compensate for the other dynamics.

At a somewhat more technical level, we can decompose the change in women's share from parliaments 18 (the parliament from 2013-2017) to 19 (the current parliament) into two effects: First, holding current women's shares by party in parliament fixed, how did election results change the overall share (election effect)? Second, holding election results fixed, what's the effect of changes in women's shares by parties (gender composition effect)?

In other words, if $w_p^j$ denotes the women's share in each party in parliament $j$ and $v_p^j$ denotes the vote share of party $p$ in parliament $j$, then the difference in women's share in parliaments 18 and 19,
$\sum_p w_p^{19}v_p^{19} – \sum_p w_p^{18}v_p^{18}$
can be decomposed into
$\sum_p w_p^{19}(v_p^{19}-v_p^{18}) – \sum_p v_p^{18} (w_p^{18}-w_p^{19})$

The first sum denotes the election effect, while the second denotes the gender composition effect. Recall that the difference in overall women share is 6 percentage points. Using data from this election and last election, one can calculate the two sums above and find that the election effect and the gender composition effect each contribute about 3 percentage points to the total decline. Hence, about half of the total decline can be explained by election results in the most recent election.

To increase the share of women in parliament, it could suffice for the SPD to win voter shares back in the next election, or more generally, for parties with a high representation of women to win more seats. Recent results of the Green party in regional elections suggest that they might also improve their vote share in the next federal election. The share of women in parliament will most likely increase then, without any need to change electoral law (as was suggested by Barley).

# Emission trends in Germany

Given recent headlines about driving restrictions for diesel cars in several German cities, I was curious about patterns of nitrogen dioxide emissions across cities and over time in the underlying data. I find that current regulations don't have much bite because seasonal variation in emissions is large. Even at measuring stations with high average annual pollution, daily average pollution can fluctuate between 20 and 140 micro grams per cubic meter. Under the assumption that regulation is unchanged, I identify several cities and stations that were below the regulation limits in 2017 but are likely to exceed limits in 2018.

I downloaded emissions data from the website of the Umweltbundesamt (Federal Environmental Agency). As common with many German administrative sources, these data are difficult to access in bulk but, with some wrangling, one can get data on daily average and daily maximum emissions for each station going back to January 2017.

Keep in mind that there are two restrictions on nitrogen dioxide emissions (see for instance here):

• The daily maximum most not exceed 200 micro grams per cubic meter on more than 18 days per year
• The annual average must not exceed 40 micro grams per cubic meter

I will only discuss the latter as the 200 micro grams restriction does not appear to be restrictive in the data.

# Annual averages

How does annual average concentration look? The figure below plots annual averages in several large German cities. 2018 data are incomplete and not directly comparable to 2017 data. It does seem, however, that the average annual concentration over all stations in a city is typically below the maximum level of 40 micro grams per cubic meter (with the exception of Munich).

# Seasonal patterns

The annual average masks substantial heterogeneity over seasons, though. Berlin, Frankfurt and Hamburg display a clear seasonal pattern with higher concentration in the winter and lower concentration in the summer. Cologne and Munich have a slightly more suprising pattern with concentration typically being higher around quarter-ends. Average concentration over the past 30 days often exceeds the 40 micro grams limit.

To me this illustrates how annual averages are not really helpful. It's like having one hand in freezing water and one hand in boiling water, fine on average, but really missing the point.

Drilling down a bit further, we can evaluate data by measuring station to see where concentration within a city is most severe and driving restrictions are most likely. For my home town of Cologne, concentration is (naturally) highest at stations closer to the city center (Turiner Str and clevischer Ring).

# Stations at increased risk of nearby-driving restrictions

Because of the aforementioned seasonalities, average annual concentration remains an unsatisfying measure. Nevertheless, under the assumption that average annual concentration continues to be the measure of choice, I was curious about stations most likely to exceed the 40 micro grams limit this year. To get a quick sense before 2018 is complete, I computed average annual concentration by station from Nov 11, 2017 to Nov 10, 2018. All of the top 15 places exceeded the 40 micro grams limit in 2017 already and continue to do so in 2018.

## # A tibble: 15 x 3
##    Stationsname                     Mean2017 MeanNov17ToNov18
##    <chr>                               <dbl>            <dbl>
##  1 Stuttgart Am Neckartor               73.0             76.7
##  2 Stuttgart Hohenheimer Straße         68.8             70.7
##  3 München/Landshuter Allee             78.2             60.5
##  4 Hamburg Habichtstraße                57.9             59.4
##  5 B Neukölln-Silbersteinstr.           48.7             58.9
##  6 Köln Clevischer Ring 3               62.1             57.4
##  7 Kiel-Theodor-Heuss-Ring              56.8             56.3
##  8 Ludwigsburg Friedrichstraße          50.8             55.8
## 10 Nürnberg/Von-der-Tann-Straße         42.6             53.8
## 11 Reutlingen Lederstraße-Ost           59.5             53.5
## 13 B Neukölln-Karl-Marx-Str. 76         49.5             53.1
## 14 Heilbronn Weinsberger Straße-Ost     56.5             52.8
## 15 Mannheim Friedrichsring              44.7             52.5


# New stations likely above the limit by year-end 2018

A few places did not exceed the limit in 2017 but are on track to exceed the limit in 2018. Expect debates about driving restrictions to pick up there.

## # A tibble: 9 x 3
##   Stationsname                    Mean2017 MeanNov17ToNov18
##   <chr>                              <dbl>            <dbl>
## 1 Mainz-Rheinallee                    35.9             46.8
## 2 Kassel-Fünffenster-Str.             38.8             46.2
## 3 Fulda-Petersberger Str.             39.4             44.5
## 4 Leipzig Lützner Str. 36             37.1             44.2
## 5 Norderstedt                         39.4             44.0
## 6 Saarbrücken-Verkehr                 36.5             43.9
## 7 Karlsruhe Reinhold-Frank-Straße     39.3             43.9
## 8 Bremen Verkehr 1                    39.2             43.2
## 9 Offenbach-Untere Grenzstraße        37.8             43.2


# Inflation trends in the Euro area – Oct 2018

This post provides an inflation update for the Eurozone with numbers through September 2018. With various adverse scenarios (Brexit, Italian banks, trade war) looming at the horizon, risks to the economic outlook are arguably tilted to the downside. Monetary stimulus provided by the ECB (negative rates, …) is still at unprecedented levels and it is unclear (to me) whether the ECB has additional measures available in case any of the mentioned (or other) scenarios leads to an economic downturn. Policy normalization in the near future appears important to be able to suport the European economy in an adverse event. I therefore look at whether policy normalization can be justified from an inflation perspective.

Eurozone inflation in September exceeded 2 percent, slightly higher than three months ago, and with somwhat higher price increases in the two biggest economies (France, Germany). While this might seem like policy normalization could be at the horizon, the headline inflation shown above is only one of several inflation measures typically considered. In particular, core inflation that excludes energy and food prices is still stubbornly low (see next graph), still close to 1 percent, and has even decreased slightly relative to three months ago.

Price levels hence do not provide a clear message towards ending extraordinary monetary stimulus any time soon. I will leave the discussion of whether such normalization might be justified from a financial stability perspective for another time.

# IMF unsurprises with lower growth forecast

The IMF lowered its forecast for global economic growth for 2018 and 2019, citing structural reasons such as increasing trade protections and a weaker outlook for emerging economies. The Wall Street Journal cites the IMF numbers as weighing on markets on Wednesday (see here).

Nobody should be surprised by downward revisions of the IMF forecasts, however. The IMF’s initial forecasts have been too optimistic each year since the Financial Crisis and have regularly been revised down. While structural economic reasons can plausibly explain the most recent revision, the revision is also consistent with a structural issue in the IMF’s model that leads to forecasts that are initially over-optimistic and require downward revisions afterwards.

To illustrate this point, I downloaded the IMF’s past forecasts for each year since the Financial Crisis, available here.

To read this plot, follow any line (say the red one), and you’ll see the growth for that year (for the red line: 2012) as forecasted in different years. You will notice that the forecast history is such that the final forecast is lower than the initial forecast by a fair amount. In between, downward revisions typically happen gradually.

The point is that one desirable property of a forecast is that it is correct on average, i.e. the forecast is sometimes too high and sometimes too low and the forecast error is 0 on average. Here, though, the forecast revisions have mostly been negative, suggesting that there might be an issue with the forecasting model, making downward revisions over time necessary regardless of the structural economic reasons cited above.

# Housing valuations in Germany (part 2)

How is the German housing market doing? In my second take on this question, I compare rent to purchase prices for apartments in Germany.

A common measure of valuation, the buy-to-annual rent ratio relates purchase price to annual rent (excluding utilities) for comparable apartments, that is, ideally, apartments of the same size, amenities and location. From an investor's perspective, the ratio answers the question: How many years does it take until my investment is amortized (excluding issues of taxation, maintenance, …), keeping rent fixed?

To compute the price-to-rent ratio, I group apartments by city and size and compute the mean purchase prices and annual rent in each group. I keep only groups with at least 10 apartments listed for rent and 10 apartments listed for purchase. The mean price-to-rent ratio is about 25.

A first result, illustrated in the figure below, is that the price-to-rent ratio increases in apartment size, so it seems that it is relatively better to rent rather than to buy larger apartments right now (unless purchase and rental listings differ more in other characteristics for larger apartments than for smaller ones).

How do the big cities do? To illustrate, I focus on apartments with living space between 80 and 110 square meters. Munich and Frankfurt are about on par with price-to-rent ratios above 30, while buying seems relatively more attractive in Hamburg or Cologne.

##                City medianPriceToRent
## 1           München             32.62
## 2 Frankfurt am Main             31.09
## 3            Berlin             28.01
## 4           Hamburg             26.92
## 5              Köln             25.95
## 6         Stuttgart             22.11


Where are price-to-rent ratios highest? Perhaps surprisingly, the top 10 miss a few big cities and include a few unexpected ones (Rostock, Solingen?). In each of these cities, one can buy an apartment for the equivalent of 30 years of rent (without purchase fees, maintenance and such). To put these values in perspective, note that they are about on par with average price-to-rent ratios in cities such as Los Angeles, Seattle or Boston (see here).

##             City medianPriceToRent
## 1         Lübeck             38.94
## 2       Landshut             36.80
## 3        Rostock             36.43
## 4  Halle (Saale)             36.01
## 5       Erlangen             35.42
## 7        München             32.62
## 8       Solingen             32.56
## 9         Coburg             31.42
## 10       Leipzig             31.27


To provide more context, it would be nice to compare these values to historical price-to-rent ratios in Germany, data that I don't have. Overall, it seems fair to say, though, that buying does not seem like an attractive investment in many places as yields are very poor. Of course, buying comes with other non-monetary utility and benefits which might still make buying a good choice for some.

# Housing valuations in Germany (part 1)

How is the German housing market doing? This morning, Zeit-Online reported results of a recent survey suggesting that most people looking for houses consider a price range of between EUR 200,000 and EUR 400,000. The price range aligns relatively well with German median income, yet, it is difficult to find housing in that price range close to the big cities (the article portrays a family that is willing to take on a 2 hour daily commute to find housing that price range).

To get a sense of valuations, I’m starting a series of posts about housing in Germany. I focus on apartments rather than houses (the apartment market seems more liquid and has more observations of listings).

In the first post, I am trying to get a quick sense of how much apartment rents are driven by apartment characteristics versus location characteristics. I start with a simple model of monthly apartment rent as a function of living space, the number of rooms, whether or not the apartment has a balcony, a garden or a kitchen. The idea is that the above apartment characteristics (to the extent available) can be viewed as fundamentals and are unrelated to location characteristics. Of course, location is important and can also provide quality of life. You can think of this post as trying to decompose rents in a part given by apartment quality and a part that might reflect location quality.

I omit the model details here, but the model explains about 70% of the variation in apartment rents. For each apartment, I compute the fundamental apartment rent as the prediced value from my model above.

The figure below shows the distribution of actual rent and rent based on fundamental value. As one can see, fundamental rent is often higher than actual rent.

How is this difference between actual and fundamental rent distributed across regions? The figure below shows results. In particular, it shows by how much actual rent deviates from fundamental rent (in percent). Positive values mean actual rent is above fundamental rent and negative values mean the opposite.
Not surprisingly, renting in cities is more expensive conditional on fixed apartment characteristics. You can clearly see Munich, Frankfurt, Stuttgart, Cologne and Berlin on the map.

Which are the cities with the highest share of apartments that are listed at least 50% above fundamental value? The top 25 are in the table below and they do include the usual suspects, in particular Munich and its surrounding region. It’s interesting to note that Cologne appears to have a much higher share of those fundamentally overvalued apartment listings than its neighboring city Dusseldorf. Does that suggest higher quality of life in Cologne?

##                               City ShareMorethan50
## 1                          München            0.76
## 2                  München (Kreis)            0.48
## 3                Starnberg (Kreis)            0.48
## 4         Fürstenfeldbruck (Kreis)            0.47
## 5                Frankfurt am Main            0.45
## 6                        Stuttgart            0.44
## 7                  Lörrach (Kreis)            0.43
## 8                            Fürth            0.35
## 9                       Heidelberg            0.35
## 10                            Köln            0.35
## 11                  Dachau (Kreis)            0.34
## 12                Miesbach (Kreis)            0.33
## 13                        Nürnberg            0.33
## 14                          Berlin            0.31
## 15                        Würzburg            0.31
## 16               Ebersberg (Kreis)            0.29
## 18                      Regensburg            0.28
## 19                         Hamburg            0.27
## 20                      Düsseldorf            0.24
## 21                       Karlsruhe            0.23
## 22 Bad Tölz-Wolfratshausen (Kreis)            0.22
## 23                        Erlangen            0.22
## 24                         Münster            0.22
## 25               Oberhavel (Kreis)            0.22


# Two-way clustering in Stata

How does one cluster standard errors two ways in Stata? This question comes up frequently in time series panel data (i.e. where data are organized by unit ID and time period) but can come up in other data with panel structure as well (e.g. firms by industry and region).

I’ll first show how two-way clustering does not work in Stata. I have seen this occasionally in practice, so I think it’s important to get it out of the way.

The standard regress command in Stata only allows one-way clustering. Getting around that restriction, one might be tempted to

1. Create a group identifier for the interaction of your two levels of clustering
2. Run regress and cluster by the newly created group identifier
##
##
## . use "http://www.stata-press.com/data/r14/nlswork.dta", clear
## (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
##
## . egen double_cluster=group(idcode year)
##
## . regress ln_wage age i.race, vce(cluster double_cluster)
##
## Linear regression                               Number of obs     =     28,510
##                                                 F(3, 28509)       =     905.75
##                                                 Prob > F          =     0.0000
##                                                 R-squared         =     0.0946
##                                                 Root MSE          =     .45494
##
##                     (Std. Err. adjusted for 28,510 clusters in double_cluster)
## ------------------------------------------------------------------------------
##              |               Robust
##      ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
## -------------+----------------------------------------------------------------
##          age |   .0196731   .0004233    46.48   0.000     .0188435    .0205028
##              |
##         race |
##       black  |  -.1377638   .0059505   -23.15   0.000    -.1494271   -.1261006
##       other  |   .0666999   .0284081     2.35   0.019     .0110187    .1223812
##              |
##        _cons |   1.141686    .012024    94.95   0.000     1.118119    1.165254
## ------------------------------------------------------------------------------


What goes wrong here? You can see already that something is off because the number of clusters is the same as the number of observations. Since, in this dataset, the combination of idcode and year uniquely identifies each observations, the above approach effectively does not cluster at all. Instead, it gives you heteroskedasticity-robust standard errors, which are typically too small. You can check this by comparing to the output the same regression as above but with the robust option.

##
##
## . use "http://www.stata-press.com/data/r14/nlswork.dta", clear
## (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
##
## . regress ln_wage age i.race, robust
##
## Linear regression                               Number of obs     =     28,510
##                                                 F(3, 28506)       =     905.75
##                                                 Prob > F          =     0.0000
##                                                 R-squared         =     0.0946
##                                                 Root MSE          =     .45494
##
## ------------------------------------------------------------------------------
##              |               Robust
##      ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
## -------------+----------------------------------------------------------------
##          age |   .0196731   .0004233    46.48   0.000     .0188435    .0205028
##              |
##         race |
##       black  |  -.1377638   .0059505   -23.15   0.000    -.1494271   -.1261006
##       other  |   .0666999   .0284081     2.35   0.019     .0110187    .1223812
##              |
##        _cons |   1.141686    .012024    94.95   0.000     1.118119    1.165254
## ------------------------------------------------------------------------------


So how does two-way clustering in Stata work then? There are a couple of user-written commands that one can use. I recommend reghdfe by Sergio Correia because it is extremely versatile. Give him credit for it if you use the command! Other good options are ivreg2 by Baum, Schaffer and Stillman or cgmreg by Cameron, Gelbach and Miller.

One issue with reghdfe is that the inclusion of fixed effects is a required option. Sometimes you want to explore how results change with and without fixed effects, while still maintaining two-way clustered standard errors. A shortcut to make it work in reghdfe is to absorb a constant. In the example above:

##
##
## . use "http://www.stata-press.com/data/r14/nlswork.dta", clear
## (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
##
## . gen temp = 1
##
## . reghdfe ln_wage age i.race, absorb(temp) cluster(idcode year)
## (converged in 1 iterations)
##
## HDFE Linear regression                            Number of obs   =     28,510
## Absorbing 1 HDFE group                            F(   3,     14) =      99.06
## Statistics robust to heteroskedasticity           Prob > F        =     0.0000
##                                                   R-squared       =     0.0946
## Number of clusters (idcode)  =      4,710         Within R-sq.    =     0.0946
## Number of clusters (year)    =         15         Root MSE        =     0.4549
##
##                            (Std. Err. adjusted for 15 clusters in idcode year)
## ------------------------------------------------------------------------------
##              |               Robust
##      ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
## -------------+----------------------------------------------------------------
##          age |   .0196731   .0014594    13.48   0.000     .0165431    .0228032
##              |
##         race |
##       black  |  -.1377638   .0133762   -10.30   0.000     -.166453   -.1090747
##       other  |   .0666999   .0664563     1.00   0.333    -.0758347    .2092346
## ------------------------------------------------------------------------------
##
## Absorbed degrees of freedom:
## ---------------------------------------------------------------+
##  Absorbed FE |  Num. Coefs.  =   Categories  -   Redundant     |
## -------------+-------------------------------------------------|
##         temp |            1               1              0     |
## ---------------------------------------------------------------+


Compared to the initial incorrect approach, correctly two-way clustered standard errors differ substantially in this example.

What goes on at a more technical level is that two-way clustering amounts to adding up standard errors from clustering by each variable separately and then subtracting standard errors from clustering by the interaction of the two levels, see Cameron, Gelbach and Miller for details. The incorrect group ID approach only computes the interaction part.

# European inflation trends in June

Eurostat released updated inflation numbers for Euro area countries last week. While data for some data is available through July, for most countries data are available through June 2018. Let us first look at annualized inflation based on the harmonized consumer price index in June 2018.

Overall price growth has been close to 2 percent in June but has exceeded 2 percent in a number of large economies, including France, Germany and Spain. At the surface, if the trend continues, the ECB might get under pressure to raise rates before summer 2019. Core inflation (price growth excluding energy and food), however, is still low across most economies. Looks like we'll have low nominal rates for a while.