1. Run a random forest with _B_ subsamples, where _P_<sup> ̄</sup> circumstances are randomly chosen to be considered at each splitting point, and _α_ is used as the value for the hypothesis tests.

2. Calculate the average predicted value of observation _i_ using each of the subsamples _b−i_ (the so called _bags_ ) in which _i_ does not enter: _y_ ˆ _i_<sup>_OOB_</sup> ( _α, P_<sup> ̄</sup> ) = _B_ <u>1</u> _−i_ � _b−i_<sup>_μ_</sup> _m_<sup>_b_(</sup><sup>_α,P_ ̄).</sup> 3. Calculate the out-of-bag mean squared error: MSE<sup>_OOB_</sup> ( _α, m_ ) = _N_<sup><u>1</u></sup> � _i_<sup>[</sup><sup>_yi −y_ˆ</sup> _i_<sup>_OOB_</sup> ( _α, P_<sup> ̄</sup> )]<sup>2</sup> .

4. Choose ( _α_<sup>_∗_</sup> _, P_<sup> ̄</sup><sup>_∗_</sup> ) = _{_ ( _{α ∈ A}, {P_<sup> ̄</sup> _∈ P_<sup>ˇ</sup> _}_ ) : argmin MSE<sup>_OOB_</sup> _}_ .

The logic behind this tuning exercise is similar to cross-validation. However, instead of leaving out the _k_ th fraction of the dataset to make out-of-sample predictions, we leverage the fact that each tree of a forest is grown on a subsample _b−i_ that excludes all observations _i_ . Hence, for each tree we can use the out-of-bag data points to evaluate the predictive accuracy of the respective model.<sup>9</sup> The improved predictive quality of random forests comes at a cost. It is no longer possible to identify a fixed set of types _T_ into which we can partition the population. For example, depending on the subset Ω<sup> ̄</sup> _⊆_ Ωused for a particular tree as well as the the particular subsample<sup>ˇ</sup> _b_ drawn from the data, it may be that _i, j ∈ t_<sup>_b_</sup> _m_<sup>but</sup><sup>_i∈tb_</sup> _m_<sup>+1</sup> while _j ∈/ t_<sup>_b_</sup> _m_<sup>+1.Asaconsequence,</sup> the individual prediction and hence the valuation of the individual opportunity set is an average over the value of opportunity sets _μ_<sup>_b_</sup> _m_<sup>associatedwitheachtreeoftheforest.Therefore,the</sup> valuation of opportunity sets is less straightforward and opportunity structures are hard to illustrate in a graphical manner. It is nevertheless possible to describe opportunity structures by calculating the relative variable importance of each _C_<sup>_p_</sup> _∈_ Ωin<sup>ˇ</sup> constructing the forest. See section 4.3 for an illustration.

# **4 Empirical Application**

In this section we provide an illustration of our methodology using harmonized survey data from 31 European countries. As outlined above, conditional inference trees and random forests solve the issue of model selection associated with the prevalent approaches to equality of opportunity estimations. Conditional inference trees are easily tractable and lend themselves to cross-sectional (and longitudinal) comparisons of opportunity structures. Conditional inference forests are less tractable but outperform the former approach in terms of predictive accuracy. In the following, we will illustrate the merits of both approaches. Furthermore, we will compare the results from both versions of our method with prevalent measurement approaches in the extant literature; namely parametric, non-parametric and latent class models. Comparisons will be made along two dimensions. First, the estimates themselves, and second, the respective out-of-sample accuracy. The latter criterion should be interpreted as an indicator of how well the respective method balances upward and downward biases in inequality of opportunity estimations. A formal argument for why this is the case, is provided in Appendix A.1.

## **4.1 Data**

The empirical illustration is based on the 2011 wave of the European Union Statistics on Income and Living Conditions (EU-SILC). EU-SILC provides harmonized survey data with respect to

> 9In principle tuning can be conducted analogously to regression trees by means of _k_ -fold cross validation. This, however, is computationally expensive. Cross-validation would require to repeat the entire estimation exercise for a total of _K_ folds. This is not necessary when using the out-of-bag error since out-of-sample points are already delivered by leaving out observations _i_ when using bag _b−i_ . Hence, in the case of forests using the out-of-bag error is _K_ times more computationally efficient than cross-validation.

11