Robust analysis of second-leg home advantage in UEFA football through better nonparametric confidence intervals for binary regression functions
Gery Geenens Thomas Cuddihy





Robust analysis of second-leg home advantage in UEFA football through better nonparametric confidence intervals for binary regression functions
    Gery GeenensCorresponding author: ggeenens@unsw.edu.au, School of Mathematics and Statistics, UNSW Sydney, Australia, tel +61 2 938 57032, fax +61 2 9385 7123 
School of Mathematics and Statistics, 
 UNSW Sydney, Australia Thomas Cuddihy 
 School of Mathematics and Statistics,
 UNSW Sydney, Australia
    December 30, 2023
=================================================================================================================================================================================================================================================================================================================

empty 

 
In international football (soccer), two-legged knockout ties, with each team playing at home in one leg and the final outcome decided on aggregate, are common. Many players, managers and followers seem to believe in the `second-leg home advantage', i.e. that it is beneficial to play at home on the second leg. A more complex effect than the usual and well-established home advantage, it is harder to identify, and previous statistical studies did not prove conclusive about its actuality. Yet, given the amount of money handled in international football competitions nowadays, the question of existence or otherwise of this effect is of real import. As opposed to previous research, this paper addresses it from a purely nonparametric perspective and brings a very objective answer, not based on any particular model specification which could orientate the analysis in one or the other direction. Along the way, the paper reviews the well-known shortcomings of the Wald confidence interval for a proportion, suggests new nonparametric confidence intervals for conditional probability functions, revisits the problem of the bias when building confidence intervals in nonparametric regression, and provides a novel bootstrap-based solution to it. Finally, the new intervals are used in a careful analysis of game outcome data for the UEFA Champions and Europa leagues from 2009/10
to 2014/15. A slight `second-leg home advantage' is evidenced.

Keywords: football; home advantage; nonparametric regression; confidence intervals; undersmoothing.



§ INTRODUCTION


The `home field advantage' in sport is well established, as its quantitative study can be traced back to the late 70's <cit.>. A meta-analysis of 30 research articles by <cit.>, including over 30,000 games, found significant home field advantages in each of 10 different sports, be it individual such as tennis or team such as football (soccer). Yet, there seems to exist a downward trend in this advantage over time. <cit.> analysed more than 400,000 games, dating back to 1876, from ice hockey, baseball, American football, basketball and football, and found a decline in home field advantage for most sports. Nevertheless, the advantage was still positive for all sports in the final year analysed (2002). 

The exact causes of that advantage are multiple and complex. In an effort to better understand them, an important literature review by <cit.> developed a conceptual framework, which was later updated by <cit.>. It incorporates 5 major components: game location; game location factors; critical psychological and physiological states; critical behavioural states; and performance outcomes. <cit.> posited that each component affects all subsequent ones. For example, `game location' influences `game location factors' such as crowd size and composition, which in turn affects the `psychological state' and then `behavioural state' of the players, etc. They concluded that further research is necessary in all of the 5 components to better understand the individual impacts, for example there is insufficient research into the effect of crowd density and absolute crowd size and their interaction. More recently, <cit.> reached a similar conclusion, and reiterated their thoughts from an analysis two decades earlier <cit.>: “Clearly, there is still much to be learnt about the complex mechanisms that cause home advantage, both in soccer and other sports. The topic remains a fruitful area of research for sports historians, sociologists, psychologists and statisticians alike.”

One aspect of the home field advantage whose existence is still being debated is that of the `second-leg home advantage' (hereafter: SLHA), when a contest between two teams comprises two matches (`legs'), with each team as the home team in one leg, and the final outcome decided on aggregate. At first sight, one might expect that each team would get their respective home advantage and that the effects would cancel out. Yet, a common belief is that the team playing at home for the second leg has a slight advantage over the other team. One theory to support this claim is that the team playing away on the first game can essentially play it safe there, while taking advantage of playing at home on the decider game when the difference is to be made. The stake of the second leg being higher, the crowd support and the induced pressure might indeed be more intense then than on the first leg, where getting the upper hand is unlikely to be final anyway. This may create an asymmetry in home advantage between the two legs <cit.>.

Those two-legged ties are very common in knockout stages of football international club competitions, such as national team play-offs in some qualification tournaments, including the FIFA World Cup, and most prominently the European cups, namely the UEFA Champions League and Europa League. Those competitions are big business, especially the UEFA Champions League. For instance, from the season 2015-2016 onwards, to qualify to the quarter-finals brings in a bonus of 6 millions of euros; to advance further to the semi-finals brings in an extra bonus of 7 millions of euros; and to qualify to the final brings in another 10.5 or 15 millions of euros (depending on the outcome of the final)[http://www.uefa.com/uefachampionsleague/news/newsid=2398575.html – these amounts are the `fixed amounts', awarded according to the clubs' performance; they excluded the so-called `market pool', which essentially comes from television income.]. Hence, beyond the sporting aspect, the difference between qualifying or being eliminated at some level of the knockout stage represents a huge amount of money. As a result, an unwarranted advantage for the team playing at home second implies an equally unwarranted economic shortfall for the team playing at home first, whose only fault is to have been unlucky at the draw. The question of existence of the SLHA is, therefore, of great significance.

Consequently, scholars have attempted to evidence or otherwise the SLHA, with research focussing on the case of UEFA administered competitions. Yet, none really proved conclusive. A naive comparison of the fraction of teams qualifying when playing at home on the second leg against when playing at home on the first leg, is not telling. This is because of the non-random manner in which UEFA sometimes seeds teams in knockout stages of their competitions. For instance, in the first knockout round following the initial group stage, such as the Round-of-16 in the Champions league or Round-of-32 in the Europa league, group winners (supposedly the best teams) are automatically assigned to play the second game at home. Obviously, this may lead to the spurious result of existence of SLHA, as stronger teams are preferentially allocated as playing at home second in some instances. This induces an obvious confounding factor.

<cit.> and <cit.> adjusted for it by conditioning their analyses on the difference between the UEFA coefficients of the two teams, assumed to be a reasonable proxy for their relative strength (more on this in Section <ref>). <cit.> found no evidence of SLHA and <cit.> found a significant effect in seasons before 1994/95 but not afterwards. By contrast, <cit.> and <cit.> did find a significant SLHA effect, however they did not control for the confounding factor, which greatly lowers the value of their study. It seems indeed clear that the relative strength of the matched teams should be taken into account for meaningful analyses. Hence this paper will focus on the `conditional' case only.

Specifically, denote p(x) the probability of the second-leg home team qualifying given that the difference in `strength' between the two teams (however it is measured) at the time of the game is x. Then, p(0) is the probability of the second-leg home team going through, given that the two teams are of the same strength. The probability p(0) is, therefore, the parameter of main interest in this study, with a value for p(0) above 1/2 indicating a second-leg home advantage. Existence of the SLHA effect can thus be formally tested by checking whether an empirical estimate p̂(0) of p(0) significantly lies above 1/2.

<cit.> and <cit.> estimated p(x) using a logistic regression model, but failed to provide an examination of goodness-of-fit of this parametric model and just stated regression estimates as-is. To offer an alternate viewpoint on the question, this paper explores the topic using nonparametric techniques, really `letting the data speak for themselves'. To this effect, a Nadaraya-Watson (NW) kernel regression model <cit.> has been developed to regress the final outcome of the two-legged knockout on a measure of the inequality in team strengths, based again on the UEFA club coefficients. This model allows robust and objective estimation of p(x) from historical data. A measure of statistical significance is provided by the asymptotic normality of the Nadaraya-Watson estimator, which enables the calculation of pointwise confidence intervals for p(x) at any x <cit.>. 

However, the working model being essentially a conditional Bernoulli model here, the estimated probability p̂(x) is some kind of `conditional sample proportion' (see Section <ref> for details). The above standard confidence intervals for p(x) thus amount to some sort of Wald intervals, adapted to the conditional case. In the classical (i.e., non-conditional) framework, it is well known  <cit.> that the coverage of the Wald interval for a proportion p can be very poor, and this for any values of p ∈ (0,1) and the sample size n. <cit.> explained how the coverage probability of the Wald interval is affected by both systematic negative bias and oscillations, 
and recommended three alternatives to the Wald interval: the Wilson, the Agresti-Coull and the Jeffreys intervals. 

The methodological contribution of this paper is twofold. First, such `better' confidence intervals will be obtained for a conditional probability estimated by the Nadaraya-Watson estimator. `Conditional' versions of the Wilson and Agresti-Coull confidence intervals will thus be constructed. When doing so, the inherent bias of the NW estimator will be a major factor to take into account, as often in procedures based on nonparametric function estimation. Consequently, the second contribution will be to devise a careful strategy for efficiently dealing with that bias when computing the above confidence intervals in practice. Finally, those will be used for the interval-estimation of the probability p(0) of interest. This will allow the research question about the existence of some SLHA to be addressed in a very robust way. 

The paper is organised as follows. Section <ref> provides an overview of the work by <cit.> and <cit.> about confidence intervals for a proportion. A particular emphasis will be on the Wilson and Agresti-Coull confidence intervals, in order to prepare for their adaptation to the conditional case in Section <ref>. 
There, some background on the standard, Wald-type interval for a conditional probability estimated by the Nadaraya-Watson estimator is provided. Then details of the derivations of the Wilson and Agresti-Coull intervals for the conditional case are given. The problem of the bias is addressed, and a novel way of choosing the right smoothing parameter when constructing the confidence intervals is suggested. The performance of the new intervals based on this strategy are then analysed through a simulation study. Section <ref> comes back to the research question and presents the results. A discussion about the implications and limitations of the current study follows, with some suggestions for future research in the field. Finally, Section <ref> concludes.




§ CONFIDENCE INTERVALS FOR A PROPORTION
 



 §.§ Background
 

Consider a random sample {Y_1,Y_2,…,Y_n}i.i.d.∼ Bernoulli(p), for some value p ∈ (0,1) (degenerate cases p=0 or p=1 have very limited interest), and say that Y_i = 1 if individual i has a certain characteristic, and Y_i=0 otherwise. Denote ≐∑_i=1^n Y_i, the number of sampled individuals with the characteristic. The sample proportion p̂ = ∑_i=1^n Y_i/n = /n is known to be the maximum likelihood estimator of p, satisfying

    √(n)(p̂ - p) 𝒩(0,p(1-p))
 
as n →∞ from the Central Limit Theorem. Substituting in p̂ for the estimation of the standard error, a confidence interval of level 1-α for p easily follows:

    CI_Wa = [p̂± z_1-α/2√(p̂(1-p̂)/n) ],

where z_a is the quantile of level a ∈ (0,1) of the standard normal distribution. This is the Wald interval. 

Unfortunately, this interval reputedly shows poor behaviour in terms of coverage probability, as has been known for quite some time, see for instance <cit.> and <cit.>. <cit.> provided a thorough understanding of the cause of the phenomenon. They showed, even for large values of n, that the pivotal function W=n^1/2(p̂ - p)/√(p̂(1-p̂)) can be significantly non-normal with large deviations of bias, variance, skewness and kurtosis. Of particular importance is the bias term <cit.>:

    (W)=(n^1/2(p̂ - p)√(p̂(1-p̂)))= p - 1/2/√(np(1-p))(1 + 7/2n+9(p-1/2)^2/2np(1-p)) + o(n^-3/2),

which is non-zero for p ≠1/2 and changes sign depending if p<1/2 or p>1/2. Hence, even though p̂ is unbiased for p, the estimation of the standard error by substituting in p̂ introduces some substantial positive or negative bias in W. This eventually results in systematic negative bias for the coverage probability of the interval based on W, a correction of which requiring a shift of the centre of the interval towards 1/2. Obviously, this problem is most serious for values of p `far away' from 1/2, i.e. close to 0 or 1. This is the origin of the popular rule-of-thumb `np(1-p) must be greater than 5 (or 10)', supposed to validate the usage of the Wald interval, but mostly discredited by (<ref>). In addition, the coverage probability also suffers from important oscillations across n and p <cit.>. This is essentially due to the discrete nature of : clearly, for finite n, p̂ can only take on a finite number of different values (0, 1/n, 2/n, …, (n-1)/n, 1), and that causes problems when approximating its distribution by a normal smooth curve, see <cit.> for details.

Hence <cit.> went on to investigate a dozen of alternatives, including the `exact' Clopper-Pearson interval, an interval based on the Likelihood Ratio test, and some intervals based on transformations such as arcsine and logit. They recommended only three of them as replacements for the Wald interval: the Wilson, the Agresti-Coull and the Jeffreys intervals. This is due to their superior performance in coverage probability and interval length, as well as their ease of interpretation. 

In this paper the Wilson and Agresti-Coull intervals will be adapted to the conditional, kernel regression-based, setting. These two intervals are derived from the asymptotic normality of the sample proportion (<ref>). As it is known, the Nadaraya-Watson estimator of the conditional probability p(x), that will be used in Sections <ref> and <ref>, is a weighted sample average, which can be regarded as a `conditional sample proportion' in this framework. In particular, the Nadaraya-Watson estimator is - under mild conditions - asymptotically normally distributed as well <cit.>, which allows a natural extension of the Wilson and Agresti-Coull intervals to the conditional case. On the other hand, the Jeffreys interval has a Bayesian derivation, being essentially a credible interval from the posterior distribution of p when some uninformative (`Jeffreys') prior is used. It is less obvious how this construction would fit in the conditional setting. It seems, therefore, reasonable to leave the Jeffreys interval on the side in this paper. 



 §.§ The Wilson and Agresti-Coull confidence intervals for a proportion
 

The Wilson interval, first described by <cit.>, follows from the inversion of the score test for a null hypothesis H_0: p=p_0, hence it is also known as `score interval'.  Like the Wald interval, it is obtained from (<ref>). The main difference, though, is that the variance factor p(1-p) is not estimated and keeps its unknown nature through the derivation. Specifically, from a statement like

    (-z_1-α/2 < p̂-p/√(p(1-p)/n) <  z_1-α/2) ≃ 1- α,

essentially equivalent to (<ref>), it follows that the confidence interval for p at level 1-α should be the set of all values of p such that

    (p̂-p)^2 ≤ p(1-p)/n z_1-α/2^2.

Solving this quadratic inequality in p yields

    CI_Wi = [p̂ + z_1-α/2^2/2n±z_1-α/2/n^1/2√(p̂(1-p̂) + z_1-α/2^2/4n)1+z_1-α/2^2/n ] = [ + z_1-α/2^2/2/n+z_1-α/2^2±n^1/2z_1-α/2/n+z_1-α/2^2√(p̂(1-p̂) + z_1-α/2^2/4n) ].

<cit.> showed that this interval can be written

    CI_Wi = [(1-w)p̂ + (w) 1/2± z_1-α/2√((1-w) p̂(1-p̂)/n+z^2_1-α/2 + (w)1/4(n+z^2_1-α/2)) ],

where w=z_1-α^2/n+z_1-α^2. This interval is symmetric around (1-w)p̂ + (w) 1/2, a weighed average of p̂ and the uninformative prior 1/2, with the weight on p̂ heading to 1 asymptotically. Compared to the Wald interval (<ref>), the interval centre is now shifted towards 1/2 which substantially reduces the bias in coverage probability as suggested below (<ref>). Likewise, the coefficient on z_1-α/2 in the ± term is the same weighted average of the variance when p=p̂ and when p = 1/2. <cit.> `strongly recommend' the Wilson interval as alternative to the Wald interval. However, they acknowledged that the form of this interval is complicated and so suggested a new interval with a simple form which they called the `Adjusted Wald interval', now better known as the `Agresti-Coull' interval.

They noted that the Wilson interval is like a `shrinking' of both the midpoint and variance estimate in the Wald interval towards 1/2 and 1/4 respectively, with the amount of shrinkage decreasing along with  n. This lead them to consider the midpoint of the Wilson interval, p̃≐ + z_1-α/2^2/2/n + z_1-α/2^2, as another point estimate of p, and then continue with the Wald Interval derivation. For the `usual' confidence level 1-α = 0.95, z_1-α/2 =1.96 ≃ 2, hence p̃≃ + 2/n + 4 and this procedure is sometimes loosely called the `add 2 successes and 2 failures' strategy. It combines the idea of shifting the centre toward 1/2, à la Wilson, with the simplicity of the Wald interval derivation which substitutes in an estimate for the standard error.

Specifically, define 

    ≐ + z_1-α/2^2/2,   ñ≐  n + z_1-α/2^2    and   p̃≐/ñ.

Then, given that p̃-p̂ = O(n^-1), it follows from (<ref>) that

    √(n)( p̃-p) 𝒩(0, p(1-p)/n ),

and acting as in Section <ref> yields 

    CI_AC =[ p̃± z_1-α/2√(p̃(1-p̃)/ñ) ].


<cit.> provided an excellent breakdown of the performance of the Wald, Wilson and Agresti-Coull intervals as a whole. The Wilson and Agresti-Coull intervals behave very similarly. In particular, they are almost indistinguishable around p=0.5 <cit.>. Most importantly, the Wilson and Agresti-Coull intervals maintain a coverage probability very close to the confidence level 1-α, and this for all p and even for small values of n, as opposed to the Wald interval whose coverage probability remains consistently below target, even for large n. The oscillations persist, though, which could be expected: it is the discreteness of the Bernoulli distribution that causes the oscillations, not how the intervals are formed. <cit.> also proved that both the Agresti-Coull and the Wilson intervals are shorter on average than the Wald interval. In the following section, conditional versions of these intervals are constructed, and it is analysed if these observations carry over to the case of estimating a conditional probability via nonparametric binary regression.



§ CONFIDENCE INTERVALS FOR A CONDITIONAL PROBABILITY
 



 §.§ Binary regression and Nadaraya-Watson estimator


Consider now a bivariate sample ={(X_1,Y_1),…,(X_n,Y_n)} of i.i.d. replications of a random vector (X,Y) ∈×{0,1} such that X ∼ F (unspecified) and Y |X ∼Bernoulli(p(X)). Now, the probability of a certain individual having the characteristic of interest is allowed to vary along with another explanatory variable X. Of interest is the estimation of the conditional probability function

    p(x) = (Y=1 | X=x).

Assuming that X is a continuous variable whose distribution admits a density f, the estimation of p(x) actually falls within the topic of regression. Indeed, 

    (Y|X=x) = 0×(1-p(x)) + 1× p(x) = p(x),

meaning that p(x) is actually a conditional expectation function. The problem is called binary regression.

Common parametric specifications for p include logistic and probit models. Their use is so customary that their goodness-of-fit is often taken for granted in applied studies. E.g., within the application considered in this paper, <cit.> and <cit.> did not attempt any validation of their logistic model. The primary tool for suggesting a reasonable parametric specification in the `continuous-response' context is often the basic (X,Y)-graph (scatter-plot). When the response is binary, though, a scatter-plot is not much informative (no clear shape for the cloud of data points, see for instance Figure <ref> below), hence binary regression actually lacks that convenient visual tool. Maybe that is the reason why the question of goodness-of-fit of a logistic regression model is so often overlooked in the literature, as if the incapacity of visually detecting departures from a model automatically validates it. Yet, without any visual guide, the risk of model misspecification is actually higher in binary regression than in other cases <cit.>, with misspecification typically leading to non-consistent estimates, biased analyses and questionable conclusions. 

In order to avoid any difficulty in postulating and validating some parametric specification for the function p, here a Nadaraya-Watson kernel regression estimator will be used. Kernel smoothing is a very popular nonparametric regression method <cit.>, and the Nadaraya-Watson (NW) estimator <cit.> one of its simplest variants. Given the sample , the NW estimator is defined as

    p̂_h(x) = ∑_i=1^n K(x-X_i/h)Y_i/∑_i=1^n K(x-X_i/h),

where K is a `kernel' function, typically a smooth symmetric probability density like the standard Gaussian, and h is a `bandwidth', essentially fixing the smoothness of the final estimate p̂_h. Clearly, (<ref>) is just a weighted average of the binary values Y_i's, with weights decreasing with the distance between x and the corresponding X_i. Hence it returns an estimation of the `local' proportion of the Y_i's equal to 1, for those individuals such that X_i ≃ x <cit.>, which is indeed a natural estimate of (<ref>). It is straightforward to see that p̂_h(x) always belongs to [0,1], as it is just a (weighted) average of 0/1 values. There exist more elaborated nonparametric regression estimators (Local Polynomial or Splines, for instance), but those usually fail to automatically satisfy this basic constraint on p(x). Hence the NW estimator seems a natural choice here.

Classical results in kernel regression <cit.> state that estimator (<ref>) is a consistent one for p(x) provided that h → 0 and nh →∞ as n →∞. Moreover, if h = O(n^-1/5), it is asymptotically normal. Specifically, adapting Theorem 4.5 of <cit.> to the binary case gives, at all x such that f and p are twice continuously differentiable, and f(x) > 0,

    √(nh)(p̂_h(x) - p(x)) 𝒩(1/2λμ_2(K) b(x), R(K) p(x)(1-p(x))f(x)),

where λ  = lim_n→∞ nh^5  <∞, μ_2(K) = ∫ u^2 K(u) du and R(K) = ∫ K^2(u) du are kernel-dependent constants, and

    b(x) = p”(x) + 2p'(x)f'(x)/f(x).

Balancing squared bias and variance, in order to achieve minimum Mean Squared Error for the estimator, requires to take h ∼ n^-1/5 <cit.>. This means λ >0, materialising a non-vanishing bias term  in (<ref>).

This bias has a major impact on any statistical procedure based on nonparametric function estimation <cit.>, and requires careful treatment. In the context of building confidence intervals, it can be either explicitly estimated and corrected <cit.>, or one can act via undersmoothing: if h=o(n^-1/5), hence purposely sub-optimal, then λ = 0 in (<ref>) which becomes 

    √(nh)(p̂_h(x) - p(x))𝒩(0, R(K) p(x)(1-p(x))f(x)).

The bias is seemingly gone; of course, at the price of an increased variance. <cit.> and <cit.> theoretically demonstrated the superiority of treating the bias via undersmoothing over explicit correction in terms of empirical coverage of the resulting confidence intervals. Clearly, (<ref>) is the analogue of (<ref>) for a conditional probability. It will consequently serve below as the basis for constructing confidence intervals for p(x) at any x. 



 §.§ Wald interval for a conditional probability
 

In particular, a Wald-type confidence interval at level 1-α for p(x) is

    CI_Wa(x;h)= [p̂_h(x) ± z_1-α/2√(p̂_h(x)(1-p̂_h(x))/nhf̂_h(x)/R(K)) ].

It directly follows from the asymptotic normality statement (<ref>) with the variance R(K) p(x)(1-p(x))/f(x) being estimated: p(x) is estimated by p̂_h(x) (<ref>), and f(x) is estimated by its classical kernel density estimator <cit.>

    f̂_h(x) = 1/nh∑_i=1^nK(x-X_i/h).

Although it would not necessarily be optimal for estimating f(x) itself, here the same kernel K and bandwidth h as in (<ref>) should be used in (<ref>). The reason why a factor 1/f(x) arises in the variance of (<ref>)/(<ref>) is that not all n observations, but only a certain fraction (asymptotically) proportional to f(x) are effectively used by the essentially local estimator (<ref>) for estimating p at x. So, the estimation of f here should be driven by accurately quantifying that `local equivalent sample size' at x. The fact that the quantity nh f̂_h(x)/R(K) is actually that equivalent sample size follows by seeing that nhf̂_h(x) is the denominator of (<ref>), while R(K) gives an appreciation of how large is the weight given to those observations `close' to x, overall.

The Wald nature of (<ref>) and the shortcomings of its analogue exposed in Section <ref>, though, motivate the adaptation of the Wilson and Agresti-Coull intervals to the conditional context.



 §.§ Wilson and Agresti-Coull intervals for a conditional probability


The derivation of the `conditional' Wilson interval follows the same steps and justification as those presented in Section <ref>. From (<ref>), it is seen that a confidence interval of level 1-α for p(x) should wrap up all those values of p(x) such that

    -z_1-α/2 < p̂_h(x) - p(x)/√(R(K)p(x)(1-p(x))/nhf(x)) <  z_1-α/2,

that is,

    (p̂_h(x) - p(x))^2 ≤ R(K)p(x)(1-p(x))/nhf(x) z_1-α/2^2.

Solving for p(x), and estimating the unknown f(x) by its kernel estimator f̂_h (<ref>), yields the interval

    CI_Wi(x;h)     = [ p̂_h(x) + z_1-α/2^2R(K)/2nhf̂_h(x)±z_1-α/2 R(K)^1/2/(nhf̂_h(x))^1/2√(p̂_h(x)(1-p̂_h(x)) + z_1-α/2^2R(K)/4nhf̂_h(x))/1 + z_1-α/2^2R(K)/nhf̂_h(x) ] 
        = [ p̂_h(x)nhf̂_h(x)/R(K) + z_1-α/2^2/2/nhf̂_h(x)/R(K)+z_1-α/2^2±z_1-α/2(nhf̂_h(x)/R(K))^1/2/nhf̂_h(x)/R(K)+z_1-α/2^2√(p̂_h(x)(1-p̂_h(x)) + z_1-α/2^2R(K)/4nhf̂_h(x)) ].

Similarly to (<ref>), the centre of this interval can be represented as (1-w)p̂_h(x) + (w)1/2, where w = z_1-α/2^2/nhf̂_h(x)/R(K)+z_1-α/2^2. This highlights that the adaptation to the conditional case has not altered the interval's nature. In addition, (<ref>) directly suggests an `Agresti-Coull', simpler version of it.

Indeed, the (non-conditional) Agresti-Coull interval (<ref>) is built around p̃, the centre of the corresponding (non-conditional) Wilson interval (<ref>). Extending this to the conditional case from (<ref>), one can define

    CI_AC(x;h) = [p_h(x)  ± z_1-α/2√(p_h(x)(1-p_h(x))/ñ_h(x)) ]

where

    p_h(x) = p̂_h(x)nhf̂_h(x)/R(K) + z_1-α/2^2/2/nhf̂_h(x)/R(K)+z_1-α/2^2     and     ñ_h(x) = nhf̂_h(x)/R(K)+z_1-α/2^2.

The interpretation of nhf̂_h(x)/R(K) as the `local equivalent sample size' makes the analogy between this and (<ref>) obvious.



 §.§ Choice of `undersmoothed' bandwidth
 

The three intervals (<ref>), (<ref>) and (<ref>) follow straight from (<ref>), which holds true if and only if h=o(n^-1/5) (undersmoothing). Results of <cit.> on asymptotic intervals in nonparametric regression, suggest that the coverage probability of the Wald-type interval (<ref>) is

    (p(x) ∈ CI_Wa(x;h)) = 1-α + O(nh^5 + h^2 +(nh)^-1).

Hence, for minimising the coverage error of the confidence interval computed on p̂_h(x), one should take h such that h ∼ n^-1/3. Common practice in nonparametric methods requiring such undersmoothing, is to take h `smaller' than a value, say h_0, supposed to be optimal for estimating p(x). Typically, h_0 would be returned by a data-driven selection procedure, such as cross-validation or plug-in, see <cit.> for a review. Often, h_0 is then just divided by some constant which heuristically looks appropriate. In the present case, one could take h = h_0 n^-1/3/n^-1/5 = h_0 n^-2/15, so as to (supposedly) obtain h ∼ n^-1/3, given that h_0 ∼ n^-1/5, see comments below (<ref>).

There is actually no justification for doing so in practice. `Undersmoothing' is a purely asymptotic, hence theoretical, concept. The `undersmoothed' h is to tend to 0 quicker than the optimal h_0 as n would tend to ∞, but this convergence is obviously meaningless when facing a sample of data of fixed size n. Indeed expressions like h ∼ n^-1/3 or h_0 ∼ n^-1/5 do not really make sense for fixed n. It is understood that, mainly because of the inherent bias of p̂_h(x), the value of h leading to confidence intervals with good coverage properties is not, in general, the optimal bandwidth h_0 for estimating p(x). However asymptotic expressions such as (<ref>) cannot really be of any practical help. In fact, there are no effective empirical ways of selecting a right h in this framework, as <cit.> deplored.

This paper fills this gap, as a sensible way of selecting such a value of h is devised. A practical procedure, it does not claim to return an `undersmoothed' bandwidth or otherwise. It just aims to return a numerical value of h which guarantees, for the data at hand, the intervals (<ref>), (<ref>) or (<ref>) to have high degree of coverage accuracy. It is essentially a bootstrap procedure, which in many ways resembles <cit.>'s idea. A main difference, though, is that <cit.> looked for the (higher) nominal confidence level that they should target for their intervals, so that their empirical versions have a coverage probability close to 1-α. Here, the approach is more direct as the constructive parameter h is the only focus. 

The procedure goes as follows:

 
  * From the initial sample , estimate p(x) by p̂_h_0(x) using an appropriate bandwidth h_0 returned by any data-driven procedure;
 
  * Generate a large number B of bootstrap resamples ^*(b)={(X_i,Y_i^*(b)); i=1,…,n}, b=1,…, B, according to Y_i^*(b)∼Bernoulli(p̂_h_0(X_i));
 
  * For b ∈{1,…,B}, compute on ^*(b) a collection of intervals[Here CI(x;h) denotes a generic confidence interval for p(x), which can be CI_Wa(x;h), CI_Wi(x;h) or CI_AC(x;h).] CI^*(b)(x;h) on a fine grid of candidate values of h;
 
  * Estimate the coverage probability of the interval CI(x;h) by the fraction P(x;h) of intervals CI^*(b)(x;h) which contain the `true' value p̂_h_0(x);
 
  * Select for bandwidth one of the values of h for which P(x;h) is above 1-α. If P(x;h) nowhere takes a value higher than 1-α, choose h which maximises P(x;h).


The intervals (<ref>), (<ref>) and (<ref>) heavily depend on the local geometry of the data around x, through the `local equivalent sample size' nhf̂_h(x)/R(K) (see comments below (<ref>)). In order for the bootstrap intervals to mimic this appropriately, the resampling in 2. is done conditionally on the design values {X_i} and those are kept fixed; only the Y_i's are resampled. Also, theoretical considerations about bootstrap methods for nonparametric curve estimation suggest that resampling such as in 2. should be done from an estimate p̂_g with g, this time, an oversmoothed bandwidth – with the same caveat about what this really means in practice. Again, the reason behind this is to do with the bias of the estimator, see e.g. <cit.>. As opposed to other procedures, though, here the bootstrap resamples are only used for identifying another bandwidth, not for direct estimation of quantities of interest. Hence, oversmoothing is not theoretically required (see <cit.> for justification of this).

This procedure is tested through simulations in the next section, where it is seen to perform very well. Those simulations show that P(x;h) is essentially a concave function of h, up to some minor fluctuations due to sampling (see Figure <ref> below), and that in almost all situations P(x;h) indeed takes values higher than 1-α. Because of concavity, the values of h for which it is the case forms a convex subset of ^+. The value of h chosen in 5. can then be the average of those values, for instance. This guarantees the selected value of h to correspond to a value of P(x;h) close to its maximum, hence leaning more to the side of conservatism than otherwise. For the rare cases in which P(x;h) does not go above 1-α, its maximum value is very close to 1-α, anyway.



 §.§ Simulation study
 

In order to test, compare and validate the above construction of confidence intervals for p(x) and the suggested bandwidth selection procedure, a twofold simulation study was run. 

Scenario 1. The data was generated according to the following process:

    X    ∼(-π,π), 
    
    Y | X    ∼Bernoulli(p(X)), 
    
    p(x)    = e^3 sin(x)/1+e^3 sin(x).

This regression function, shown in Figure <ref>, was used in Example 5.119 in <cit.>. The three confidence intervals (<ref>), (<ref>) or (<ref>) for p(x) at x=0 and x= π/2 were computed on M=1,000 independent samples generated as above. All confidence intervals were truncated to [0,1] when necessary. The coverage probabilities of the three intervals, at the two locations, were approximated by the fraction of those M=1,000 intervals which include the true values p(0) = 1/2 and p(π/2) ≃ 0.953. In the non-conditional case, values of p close to 0 or 1 are known to be problematic (see comments below (<ref>)), so comparing how much impact the value of p(x) has on the performance of the `conditional' intervals is of interest. To isolate that effect, a uniform design for X was considered, to ensure that the areas `close to x=0' and `close to x=π/2' are equally populated by data.



Three sample sizes were considered: n=50 (`small' sample), n=250 (`medium' sample) and n=1000 (`large sample'). The targeted confidence level was 95%, i.e. α = 0.05. For each sample, the values of h to use in (<ref>), (<ref>) or (<ref>) were determined by the procedure described in Section <ref>. The initial value of h_0 was taken here as the theoretically optimal value of the bandwidth for estimating p - in this simulation study it is accessible as we know the `truth': it is h_0 ≃ 0.745 n^-1/5. This allows a fair comparison of the observed results as they are not impacted by other arbitrary decisions. The number of bootstrap replications was set to B=1,000 and the best value of h was looked for on a grid of 200 equispaced values from 0.05 to 2. The final value of h was taken as the centre (average) of the set of values producing an estimated coverage higher than 95%, as suggested at the end of Section <ref>. The (approximated) coverage probabilities of the intervals built according to this procedure are given in Table <ref>.



It emerges from Table <ref> that the Wilson and Agresti-Coull intervals reach an empirical coverage consistently very close to the targeted 95%, and this for all sample sizes and at both locations (i.e., both when p(x) ≃ 1/2 and p(x) ≃ 1). A notable exception, though, is when x = π/2 and n=50 (`small' sample). As explained in Section <ref>, the number of observations effectively playing a role in estimating p at x is nh f̂_h(x)/R(K). Here, with n=50, f ≡ 1/(2π) and R(K) = 1/(2√(π)) (for K=ϕ the standard Gaussian kernel), the local equivalent sample size is roughly 1 observation for the values of h around h_0. That means that the effect of the shrinkage described below (<ref>) is severe here, and the centre of the interval is seriously held back toward 1/2. At x=0, this is a good thing as p(0)=1/2, and the observed coverage is actually higher than 95%; at x=π/2, with p(π/2) close to 1, this is detrimental to the level of the intervals (which keep an empirical coverage higher than 90%, though). As expected given the behaviour of its non-conditional counterpart, the Wald interval struggles to maintain a reasonable level of coverage, even at large sample sizes or in favourable cases (x=0). Only when x=0 and n=1000 does the Wald interval produces reasonable results (but still slightly less accurate in terms of coverage probability than Wilson and Agresti-Coull). 

Another perspective on this is provided by Figures <ref> and <ref>, which show boxplots of the lengths of the M=1,000 confidence intervals computed from each construction for n=1000, as well as the selected values of h, for x=0 and x=π/2. At x=0, the three intervals are always very similar, and so are the values of h selected by the procedure described in Section <ref>. The empirical coverage are, therefore, similar as well as shown by Table <ref>. At x=π/2, however, the procedure selects values of h much smaller for the Wilson and Agresti-Coull intervals, than for the Wald interval (Figure <ref>, right panel). This means that the constructed Wilson and Agresti-Coull intervals are indeed longer than the Wald interval (Figure <ref>, left panel), but that is the price to pay to keep a coverage probability of 95%. Recalling that h is selected via a bootstrap procedure, the value of h guaranteeing a high coverage for the bootstrap replications of the Wald interval, is not guaranteed to maintain such high coverage `in the real world'. For the Wilson and Agresti-Coull intervals, on the other hand, that is the case.





Figures <ref> and <ref> also show the optimal value h_0 = 0.188 (for n=1000; dashed line in the right panel). According to the boxplots, the value h supposed to be good for constructing the confidence intervals (<ref>), (<ref>) or (<ref>) is, for many samples, smaller than h_0, in agreement with what `undersmoothing' suggests. It is, however, not always the case. Oftentimes (especially at x=0), taking h (much) greater than h_0 seems to be the right thing to do. The fact that a `small' h is not always ideal is easily understood through the case x=0. In this scenario, due to symmetry, p(0) is actually equal to (Y) = p, the non-conditional probability (Y=1). As a result, any confidence interval for p such as those described in Section <ref> can be used for p(0) as well. This is advantageous, as the sample average Y̅=p̂ is naturally a better estimator (smaller variance, no bias) of the global p than any local (h `small'), conditional attempt. Those `non-conditional' intervals are actually recovered from (<ref>), (<ref>) or (<ref>) as h→∞. Indeed, it is known that taking a large bandwidth in nonparametric regression essentially makes local estimators into global ones <cit.>. Intuitively, if h is very large (h ≃∞) in (<ref>) then all observations are equally weighted and p̂_∞(x) just reduces to the sample average Y̅=/n=p̂. Therefore, it is beneficial to take h `large' here. Of course, this is a very particular situation, but it exemplifies that the best h really depends on the design and is not necessarily `small'. Hence heuristic rules such as taking h = C_n h_0, with C_n a small constant (possibly depending on n), are thus to be precluded and h should be selected by a careful data-driven selection procedure. This shows the value of the procedure developed in Section <ref>.

Scenario 2. The purpose of this second scenario is to empirically validate the real data analysis shown in the next section. Essentially the same study as in Scenario 1 was repeated, but this time data sets of size n=1350 were generated as

    X    ∼ 0.45 ×(-1,1/4) + 0.55 ×(0.8,1/4), 
    
    Y | X    ∼Bernoulli(p(X)), 
    
    p(x)    = 1/1+e^-0.088-0.770 x.

The above mixture of Normals is a good parametric approximation of the distribution of the predictor X in the application below (Figure <ref>), the above function p is the best logistic fit for the analysed data (Figure <ref>), and the sample size n=1350 is akin to that sample size as well. Hence the results of this simulation gives an appreciation of the validity of the real case analysis described in the next Section. Again, M=1,000 independent samples were generated. For each of them, the values of h to use in (<ref>), (<ref>) or (<ref>) were determined by the procedure described in Section <ref>. The coverage probabilities of the three types of confidence intervals for p(0) was approximated by the fractions of the M=1,000 such intervals which include the true p(0) = 0.522. Those were 0.934 for the Wald interval, 0.953 for the Wilson interval, and 0.955 for the Agresti-Coull interval. Figure <ref> shows the lengths and selected values of h for the M=1,000 independent samples generated in this scenario. The conclusion are very similar to what was said for the case x=0, n=1000 in Scenario 1. In particular, both the Wilson and Agresti-Coull intervals show coverage probabilities very close to their nominal level 95%, while, as p(0) ≃ 1/2 and n is `large', the Wald interval is not doing too bad either. This indicates that the conclusions drawn in Section <ref> can be given some credibility.






§ ANALYSIS OF UEFA COMPETITIONS
 



 §.§ UEFA coefficients
 

The main aim of this analysis is to investigate the existence, or otherwise, of the Second Leg Home Advantage (SLHA) in UEFA competitions (Champions League and Europa League). The SLHA is described as the advantage in a balanced two-legged knockout tie whereby teams are, on average, more likely to qualify if they play at home in the second leg. Hereafter, the team playing at home on the second leg will be called `Second Leg Home Team' [SLHT], and conversely for the `First Leg Home Team' [FLHT]. Table 1 in <cit.> exemplifies that many players and coaches believe that the SLHA exists. Maybe more surprising is that the UEFA body itself seems to believe in it as well: the design of the UEFA Champions and Europa Leagues is such that teams which finished first in their group in the first stage, are rewarded by being guaranteed to play the second leg at home in the first subsequent knockout round. 

If only for that, any serious empirical analysis of the SLHA effect must adjust for team strengths, as briefly explained in Section <ref>. This said, the `strength' of a team is a rather vague concept, which in addition is likely to vary over the course of a season according to many imponderable factors (e.g., the injury of a key player may seriously affect a team's abilities). A simple proxy for such `strength' seems to be the UEFA club coefficient. Its calculation is actually based on two elements: first, an individual club index, obtained from the points awarded to the team for their performance during the course of the Champions or Europa league each year (details to be found in <cit.>); second, a country index, which is the average of the indices of all the clubs of the same country which took part to a European competition that year. The country index for a particular season is defined as the sum of that country's points from the previous five seasons. Since 2009, the club UEFA coefficients have been calculated as the sum of the clubs points from the previous five seasons plus the addition of 20% of the relevant country coefficient for the latest season.[Between 2004-05 and 2008-09, the country weight was 33%, whereas it was 50% before 2003-04. ] The club coefficients take thus into account the recent performance of the club in European competitions, but also the strength of the league from which the team comes. Although not perfect, they form the basis for ranking and seeding teams in the UEFA competitions, and should be reasonably representative of the relative overall strengths of the teams over one season.

Support for this assertion is indirectly provided in <cit.>. They hypothesised that, as the club coefficients are only updated at the end of each season, group stage performance would provide a more up-to-date measure of team strength for the following knockout rounds. As such, they included both club coefficients and group stage performance as predictors in their logistic regression model. It turned out that `group stage performance' was not statistically significant either in a model by itself or in a model which also used `club coefficient' (which was significant). It seems, therefore, fair to consider the UEFA coefficient of clubs as the main indicator of team strength for a given season, and the modelling below will make use of that index only.



 §.§ Preliminaries
 

Data preparation. The analysed data, all drawn from <cit.>, include all match results from UEFA Champions and Europa leagues from 2009/2010 through to 2014/15 and the UEFA coefficients of all clubs which took part to some European competition for those seasons. Initially, data from seasons 1999/00 to 2014/15 were planned to be analysed, however UEFA has changed the method for calculating the club coefficients three times during that period. These changes mean that the time periods (1999/00 to 03/04, 04/05 to 08/09, and 09/10 onwards) are no longer directly comparable given that the UEFA coefficients would be fundamentally different variables. This necessitated analysis of only one time period, and the most recent (2009/10 to 2014/15) was naturally chosen. It would have been possible to recalculate the UEFA coefficients of each club for the years prior to 2009 using the current method, but it is probably meaningful here to focus on the last years only, given the possible fading of the SLHA over years that have sometimes been suggested by previous studies (see Section <ref>). This analysis will consequently evaluate the existence of the SLHA `now', and not from a historical perspective.

Altogether, 4160 matches were played in the Champions and Europa leagues from 2009/2010 to 2014/2015. Of course, only the knockout two-legged ties were of interest in this study. Hence, the first, obvious action was to remove group stage games, played in a round robin style and not qualifying as a two-stage knockout, and match-ups where only one game was played such as Finals or match-ups where one game was cancelled (it happened that some games were cancelled due to security concerns, or others[http://www.uefa.org/news/newsid=1666823.html]). It remained n=1353 two-legged ties (i.e., pairs of matches), both in qualifying rounds (before the group stage) and in final knockout stage (after the group stage).

In a two-legged knockout tie, the aggregate score over the two matches is tallied and the team which scored the most goals on aggregate is declared the winner and qualifies to the next round. If the teams have scored an equal number of goals, the so-called `away goals rule' applies: the team which scored most `away from home' would qualify. If this criterion does not break the tie, then two extra periods of 15 minutes are played at the end of the normal time of the second leg. If the teams are still tied then, the result is decided by penalty shoot-out. For games which went to extra-time (there were n_ET = 84 of them), it is reasonable to hypothesise that some SLHA may be induced by the fact that the SLHT plays 30 minutes longer at home than the FLHT, hence benefiting more from its home advantage <cit.>. This could justify to exclude those games from the study, given that they should artificially give rise to some sort of SLHA. It was, however, decided to keep them in a first time, arguing that it might precisely be the key element to take into account when assessing the SLHA. The possibility of playing extra time and/or taking penalties on their home ground might explain why most players favour playing at home on the second leg. In a second time, those n_ET=84 games will be excluded from the analysis, in order to appreciate the real effect of extra-time/shoot-out on the SLHA (see Section <ref>).

Predictor. Call Y the binary outcome of a two-legged tie, and for the ith tie define Y_i = 1 if the SLHT qualifies and Y_i = 0 otherwise (hence, if the FLHT qualifies). The study is based on the regression of Y on an explanatory variable X quantifying the inequality in strength between the two teams involved. Call C_1 and C_2 the UEFA coefficients of the FLHT and SLHT, respectively, at the time of meeting, and define[There are actually two occurrences where teams had a coefficient of zero, which causes a problem for defining their logarithm: two teams from Gibraltar made their first appearances in 2014/15, and Gibraltar itself was a newly accepted member of the UEFA so had a country coefficient of zero as well. Those teams were artificially given a coefficient of C=0.001, well below the next smallest coefficient of 0.050.] 

    X = log(C_2/C_1)=log(C_2) - log(C_1).

A positive value of X indicates that the SLHT is stronger than the FLHT, and conversely for a negative X. The value X=0 indicates an exactly balanced tie. The value X_i is the observed value of X for the ith tie.

Note that <cit.> and <cit.> used the difference C_2-C_1 as control variable (<cit.> actually used a normalised version of it). The reason why a log transformation is introduced in (<ref>) is that C_1 and C_2 are positive variables. It turns out that two positive numbers are more naturally compared through their ratio than through their difference.[There are mathematical reasons for this. Algebraically, (^+,×) is a group, (^+,+) is not. The Haar measure (i.e., the `natural' mathematical measure) on (^+,×) is ν(dx) = dx/x, translating to the measure of an interval [a,b] ⊂^+ being log(b)-log(a).] As an illustration, in the first qualifying round of the Champions League 2014-2015, the Sammarinese team of La Fiorita (C_1=0.699) faced the Estonian team of Levadia Tallinn (C_2=4.575); the same year, in the semi-finals, FC Barcelona (C_1=157.542) clashed with Bayern München (C_2 = 154.328). The (absolute) difference in coefficients is roughly the same for both ties (3.876 and 3.214, respectively), however anybody with a slight appreciation for European football would know that the second case, bringing together two giants of the discipline, was to be much tighter than the first one, opposing a new-coming team from one of the weakest leagues in Europe (San Marino) to a more experienced team from a mid-level league. The ratio of the coefficients C_2/C_1, respectively 6.545 and 1.021 for the above two ties, is much more representative of the relative forces involved. 

Figure <ref> shows the kernel estimate f̂ (<ref>) of the density f of the predictor X, overlaid to an histogram. The bandwidth h=0.252 was selected by direct plug-in <cit.> and the kernel was the standard Gaussian density. The estimate clearly suggests that f is bimodal. This can be understood the following way. In the qualifying rounds, it is very rare to see two teams of very similar strength facing each other: there is often a team `much stronger' (at that level) than the other. See the above example La Fiorita versus Levadia Tallinn: although the two teams can be considered `weak' and both their UEFA coefficients are `low', the ratio of those coefficients unequivocally tells which team is likely to qualify. A value of X close to 0 is actually only observed if the UEFA coefficients of the two matched-up teams are really of the same order, and that typically happens in the final rounds, when the strongest teams meet (for example, FC Barcelona versus Bayern München, see above). There are, obviously, much more qualifying games than semi-finals, hence there are comparatively less games characterised by a value of X close to 0, than otherwise. In any case, f̂ shows a peak on the positive side noticeably higher than that on the negative side. In fact, the observed proportion of positive values X_i's is 752/1353 = 0.556 (Wilson confidence interval: [0.529;0.582]). This means that the stronger team is indeed more often the SLHT than the contrary, which confirms the existence of the confounding factor described in Sections <ref> and <ref>, and the necessity of taking it properly into account.



Model. In this application, it is is sensible to treat the observed values X_i = log(C_2,i)-log(C_1,i) of the predictor as known constants set by the design (`fixed design'), and it will be assumed that

    Y_i |X_i ∼Bernoulli(p(X_i))

for i = 1,…, n =1356, independently of one another. The function p is left totally unspecified except that it is twice continuously differentiable.



 §.§ Analysis
 

The Nadaraya-Watson estimator p̂_h_0 (<ref>) was computed on the data set = {(X_i,Y_i); i=1,…,n}. The kernel K was the standard Gaussian density, while the optimal bandwidth was approximated by the method based on AIC described in <cit.>,[This bandwidth selector is implemented in the R package np.] which returned h_0 = 0.525. The resulting estimate is shown in Figure <ref> (left). Common sense suggests that p should be a monotonic function of x, hence the little `bump' in p̂_h_0 between x=-5 and x=-4 is most certainly due to random fluctuation only. This happens in an area where data are rather sparse, so it is not surprising that the nonparametric, essentially local, estimator is not the most accurate there. If the focus of the analysis was that part of the range of values of X, then more involved estimation methods could be used (e.g., adaptive estimation based on variable bandwidths, robust version of the NW estimator such as LOESS, or isotonic regression). However, this study is mainly interested by what happens around x=0, where data are abundant. The NW estimate p̂_h_0 looks well-behaved and smooth over [-2,2], say (see close-up in Figure <ref>, right), so it is probably enough here. In particular, the estimator gives p̂_h_0(0) = 0.539 > 1/2, indicating a potential SLHA. The statistical significance of this effect is examined below by computing the confidence intervals (<ref>), (<ref>) and (<ref>) for p(0), using a bandwidth h obtained from the procedure described in Section <ref>. Details are given below.



Step 1. is what Figure <ref> shows. In Step 2., B=5,000 bootstrap resamples were generated as Y_i^*(b)∼Bernoulli(p̂_h_0(X_i)); i=1,…,n, b = 1,…,B.  For Step 3., an equispaced grid of 200 candidate values for h, from h=0.05 to h=2, was built. On each bootstrap resample, the 3 confidence intervals (<ref>), (<ref>) and (<ref>) at x=0 for each candidate value of h were computed. The appearance of the functions P(0;h) (Step 4.) for the three types of intervals is shown in Figure <ref>. The returned values of the bandwidth to use (Step 5.) were obtained as the average of all the values h which give an estimated coverage higher than 95%. Those were: h=0.873 for the Wald interval, and h=0.854 for both the Wilson and the Agresti-Coull interval. With these values of h in (<ref>), (<ref>) and (<ref>), we obtain as 95% confidence intervals for p(0):

    CI_Wa(x=0;h=0.873) = CI_Wi(x=0;h=0.854) = CI_AC(x=0;h=0.854)  = [0.504; 0.574].

Interestingly, with this sample size, the three intervals are mostly indistinguishable, as they differ only from the fourth decimal digit. Of course p=1/2 does not belong to this interval, evidencing the statistical significance of the SLHA (more on this in Section <ref>).



From a methodological point of view, it is interesting to note that the empirically `optimal' bandwidth h for building the confidence intervals (here h ≃ 0.86) is actually greater than the bandwidth h_0 = 0.525, considered `best' for estimating p. As already noted in Section <ref>, this is in contrast to what a naive interpretation of `undersmoothing' would suggest (to take h smaller than h_0). Admittedly, h_0 still belongs to the acceptable area ({h >0: P(0;h) ≥  0.95}), see Figure <ref>. However, if one took h = h_0 n^-1/3/n^-1/5 as it has sometimes been suggested in the literature following (<ref>), it is here h=0.2 and the so-produced intervals would have a coverage probability much lower than the targeted 95%. Note that taking h too small has also an adverse effect of the length of the intervals, given that the standard error of the estimator p̂_h(x) is essentially inversely proportional to h, by (<ref>)-(<ref>). This confirms that ad-hoc procedures aiming at producing a supposedly `undersmoothed' bandwidth need not work well in finite samples, and should not be used.

For completeness, some elements of analysis based on a parametric logistic model are briefly given below. Importantly, it is noted that a classical goodness-of-fit test for GLM based on the deviance and Pearson's residuals rejects the logistic model for the data (p-value ∼ 0.001). The le Cessie-van Houwelingen test <cit.>, precisely based on the Nadaraya-Watson estimator (<ref>), shows marginal evidence against it as well (p-value =0.06). Therefore, what follows is not fully supported by the data, and is shown for illustration only. The fitted logistic model is (p(x)) = α + β x, and the coefficients are estimated at α̂ = 0.088 and β̂ = 0.770. This logistic fit is shown in Figure <ref>, overlaid to the Nadaraya-Watson estimator, to appreciate their discrepancy around 0. A 95% confidence interval for α is [-0.035;0.210] ∋ 0, indicating the non-significance of the intercept. Given that p(0) = e^α/(1+e^α), this translates into a 95% confidence interval [0.491,0.552] ∋ 1/2 for p(0). Hence an analysis based on logistic modelling would fail to highlight a potential SLHA. Figure <ref> reveals that the constrained logistic specification for p forces the estimate to `take a shortcut' compared to what the data really say (i.e., the nonparametric estimate), and that smoothes over the interesting features around 0. Remarkably, the length of the interval for p(0) based on this parametric model is 0.061, whereas the nonparametric confidence interval (<ref>) is only slightly longer (margin of 0.070). The price to pay for the flexibility and robustness granted by the nonparametric approach does not seem to be in terms of precision (i.e., length of the confidence intervals) in this study.



Finally, the nonparametric analysis was repeated, but this time excluding the ties which went to extra-time, in order to appreciate the effect of those on the existence or otherwise of the SLHA. There were n_ET = 84 such occurrences of extra-time, so it remained 1269 two-legged ties. The estimated Nadaraya-Watson estimator (h_0 =0.539 by AIC criterion, standard Gaussian kernel) is shown in Figure <ref>. Compared to the estimator using all data, the two curves are remarkably close around 0. This `no-extra-time' version gives p̂_h_0(0) = 0.540. So, somewhat surprisingly, the magnitude of the SLHA is actually not influenced at all by the `extra-time' element. What the plot reveals, though, is that the two curves move apart as x moves away from 0. For x>0, the dashed line (`no-extra-time' curve) is above the solid line, and conversely for x<0. This can be interpreted the following way: when an underdog playing away on the second leg still manages to qualify, that happens `often' after extra-time, i.e., after a long and though battle. Indeed, one doesn't expect an underdog to go and qualify easily at the home ground of a much stronger team.






 §.§ Discussion
 

This analysis investigated the existence of a second leg home advantage in two-stage knockout matches in the UEFA Champions and Europa leagues from 2009/10 to 2014/15. A significant effect was found. This finding contrasts with other research where the difference in team strength was controlled for, most relevantly <cit.>, who found a significant positive SLHA that had disappeared by 1995/96, and <cit.>, who found no effect. Obviously, these conflicting conclusions may have many different origins. First and foremost, the analysed data were not exactly the same. <cit.> analysed historical data from all the European cups from their early time (1955/56) up until 2005/06 (taking into account a potential effect of time), while <cit.> looked only at the final knockout stage of the UEFA Champions League from 1994/95 to 2009/10.

In this paper it was decided to analyse data from 2009/10 to 2014/15 in order to keep the control variable X, based on the UEFA club coefficients, homogeneous across the study. Indeed, the way that the UEFA calculates those coefficients have drastically changed over time, most recently in 1999, 2004 and 2009. <cit.> acknowledged this issue and addressed it by using indicator variables to create three covariates to include in their logistic model:

    (p(x)) = α + β_1 𝐈_(60/61-98/99)x + β_2𝐈_(99/00-03/04)x + β_3𝐈_(04/05-05/06)x

(where in their case, x is the difference in UEFA coefficients, as mentioned in Section <ref>). This allowed them to estimate the second-leg home advantage across all seasons as a whole whilst controlling for team strength via the three calculation methods simultaneously. However the usefulness of an overall measure is not particularly high as the strength of the effect is known to be changing within the same time period. Their refined time series analysis of the effect essentially breaks the data down into sub-time periods, anyway. <cit.>, on the other hand, did not account for the differences in coefficient calculation methods, or at least they did not mention anything of that sort. In fact, they incorrectly stated that their entire dataset utilises 20% of the country coefficient and then assume that there are no changes in calculation method [their Section 2.3]. However, there were three changes in the weight that the country index carries over the period that they studied (see Footnote <ref>.). The control variable was also different, as here the log-difference between the UEFA coefficients was used, as opposed to their difference in <cit.> and <cit.>. This is arguably more natural for comparing such positive indices. 

Finally, <cit.> and <cit.> both used logistic regression modelling, but neither provided, or made reference to, any diagnostics investigating the validity of their models. Yet, there are serious concerns about it. For instance, Figure 2 in <cit.> indicates that, for a maximum (normalised) difference in UEFA coefficients (-1 or 1), so in the most unbalanced tie one can imagine, the `underdog' team keeps around 20% chance of qualifying. Common sense alone suggests that, if La Fiorita was ever to face FC Barcelona, they would not have 1 in 5 chances of qualifying. 

Actually, testing the goodness-of-fit of the logistic model for the data analysed in this paper lead to reject it. Worse, forcing a logistic-based analysis did not allow a significant SLHA effect to be highlighted, whereas it was picked up by the nonparametric procedure. 
Highlighting a significant SLHA effect opens the door for further analyses. For instance, <cit.> analysed 199 two-legged knockout ties from the Champions and Europa leagues from 1994/95 to 2006/07, and investigated whether the number of goals scored in each leg is associated with the second-leg home advantage. Table <ref> shows that the average goals scored by the away team in each leg remains similar but the goals scored by the home team increases approximately 33% from the FLHT to the SLHT. This suggests that the cause of any potential second-leg home advantage is not due to any pressures or influences on the FLHT when playing away on the second leg, but rather it is a boost to the performance of the SLHT on their own soil relative to the FLHT on theirs. Admittedly this analysis did not control for the relative team strengths (see Section <ref>) but it does provide an interesting avenue for future research to explore. Reproducing this type of analysis whilst controlling for team strengths would probably provide a better understanding of whether the effect is an advantage to the SLHT or more so a disadvantage to the FLHT - or both.



More specific questions may be asked as well. For instance, <cit.> stated in their review that the home field advantage is apparently universal across all types of sport, yet not universal across all teams within a sport. Investigating if the second-leg home advantage affects different teams individually would also be of interest. Historically, some clubs have indeed demonstrated expertise in improbable comebacks when playing home on the 
second leg, what is now known in the football folklore as remontada (Spanish for `comeback' or `catch-up'). Research could also turn to the realm of psychology and sociology, attempting to develop for the SLHA a conceptual framework similar to that of <cit.> and <cit.> and briefly exposed in Section <ref>.



§ CONCLUSION
 

Motivated by a formal analysis of the existence (or otherwise) of the so-called `second-leg home advantage' in some international football competitions, this paper aimed to develop better tools for drawing reliable conclusions from a binary regression model, that is, when a conditional probability function p(x) is to be empirically estimated. In particular, a reliable method for constructing pointwise (i.e., for a fixed value of x) confidence intervals with good empirical coverage properties was needed. 

Avoiding rigid and sometimes unwarranted parametric specifications for the function p, the method developed here is based on the Nadaraya-Watson estimator, arguably one of the simplest nonparametric regression estimators. In the case of a binary response, this estimator returns a kind of `conditional sample proportion', from which standard confidence intervals of Wald type can easily be constructed. However, in the basic case of estimating a binomial probability, the Wald confidence interval is known to perform very poorly, and alternative confidence intervals, such as the Wilson and the Agresti-Coull intervals, have been strongly recommended.

The first main methodological contribution of the paper was to extend those `better' confidence intervals to the conditional case. Given that the Nadaraya-Watson estimator is a locally weighted average of the observed binary responses, that extension was very natural and did not present any problem. `Conditional versions' of the Wilson and Agresti-Coull intervals were thus proposed. Actually, any estimator of type 

    p̂_θ(x) = ∑_i=1^n W_i(x;θ) Y_i,

where {W_i(·;θ); i=1,…,n} is a set of weights, possibly depending on a parameter θ (often: a smoothing parameter, such as a bandwidth) and summing to 1, can be regarded as a `local sample proportion', and hence could serve as the basis of the methodology mutatis mutandis. Nonparametric regression estimators of type (<ref>) are known as linear smoothers, and include many common nonparametric regression estimators such as Local Linear, Splines or basic (i.e., without thresholding) Wavelet estimators, for instance. The methodology developed here is thus very general.

As often when nonparametric function estimation is involved, the inherent bias of estimators like (<ref>) constitutes a major stumbling block when devising inferential tools. When building confidence intervals, it has been advocated that proceeding via undersmoothing, that is, working purposely with a sub-optimal bandwidth, would be beneficial in theory. However, an attractive and effective data-driven procedure for selecting such an `undersmoothed' bandwidth was missing up until now. The second main methodological contribution of the paper was to suggest such a procedure, based on some bootstrap resampling scheme. 

Somewhat surprisingly, the bandwidth returned by the procedure and supposed to be optimal for building good confidence intervals, was not seen to be necessarily smaller than what it should be otherwise. That is in contrast with what a naive interpretation of `undersmoothing' would suggest. The procedure was validated through a simulation study, and proved very efficient at returning a bandwidth guaranteeing empirical coverage very close to the nominal level for the so-constructed intervals in all situations. Importantly, nothing in the procedure pertains to the binary regression framework, so it is clear that the suggested methodology can be used for selecting the right bandwidth for building confidence intervals for a general regression function as well.

These new intervals were finally used for answering the research question as to the existence of the second-leg home advantage in international football competitions. To that purpose, data from the UEFA Champions and Europa leagues from 2009/10 to 2014/15 were collected and analysed. Working within the regression framework allowed for the abilities of the teams involved to be taken into account, which, due to UEFA seeding regulations, confounds the relationship between playing at home in the second game and the probability of a qualification. This confounding factor was confirmed by an explanatory analysis of the data. For reasons made clear in the paper, the relative strength of the matched teams was measured through the log-difference of the UEFA coefficients of the clubs. Then, the nonparametric model revealed a significant second-leg home advantage, with an estimated probability of qualifying when playing at home on the second leg of 0.539 and 95% confidence interval [0.504;0.574], after controlling for the teams' abilities. The existence of such an unwarranted advantage for the team playing at home second may call for some system of compensation and/or handicap in knockout stages of UEFA administered competitions.

Importantly, the analysis provided is this paper is very objective, in the sense that, purely nonparametric in nature, it does not rely on any arbitrary assumption enforced by the analyst and which could orientate the conclusions in one or the other direction. In particular, no second-leg home advantage effect was evidenced by previous research, exclusively based on parametric models such as logistic regression but without any justification or validation of that parametric specification. It is revealing to observe that, although not fully supported by the data here, a similar analysis based on logistic modelling was not able to highlight the effect. Model misspecification can, indeed, hide interesting features.




§ ACKNOWLEDGEMENTS
 
This research was supported by a Faculty Research Grant from the Faculty of Science, UNSW Sydney (Australia).



99
[Agresti and Coull(1998)]Agresti1998 Agresti, A. and Coull, B.A. (1998), Approximate is better than “exact” for interval estimation of binomial proportions, Amer. Statist., 52, 119-126.
[Blyth and Still(1983)]Blyth1983 Blyth, C.R. and Still, H.A. (1983), Binomial confidence intervals, J. Amer. Statist. Assoc., 78, 108-116.
[Brown et al(2001)]Brown2001b Brown, L.D., Cai, T.T. and DasGupta, A. (2001), Interval estimation for a binomial proportion, Statist. Sci., 16, 101-133.
[Brown et al(2002)]Brown2002 Brown, L.D., Cai, T.T. and DasGupta, A. (2002), Confidence intervals for a binomial proportion and asymptotic expansions, Ann. Statist., 30, 160-201.
[Carron et al(2005)]Carron2005 Carron, A.V., Loughhead, T.M. and Bray, S.R. (2005), The home advantage in sports competitions: Courneya and Carron's (1992) conceptual framework a decade later, J. Sports Sci., 23, 395-407.
[Chen and Qin(2002)]Chen2002 Chen, S.X. and Qin, Y.S. (2002), Confidence intervals based on local linear smoother, Scand. J. Statist., 29, 89-99.
[Copas(1983)]Copas83 Copas, J.B. (1983), Plotting p against x, J. Roy. Statist. Soc. Ser. C, 32, 25-31.
[Courneya and Carron(1992)]Courneya1992 Courneya, K.S. and Carron, A.V. (1992), The home advantage in sport competitions: A literature review, Journal of Sport and Exercise Psychology, 14, 13-27.
[Cressie(1978)]Cressie1978 Cressie, N. (1978), A finely tuned continuity correction, Ann. Inst. Statist. Math., 30, 435-442.
[Eguchi et al(2003)]Eguchi03 Eguchi, S., Kim, T.Y. and Park, B.U. (2003), Local likelihood method: A bridge over parametric and nonparametric regression, J. Nonparametr. Stat., 15, 665-683.
[Eubank and Speckman(1993)]Eubank1993 Eubank, R.L. and Speckman, P.L. (1993), Confidence Bands in Nonparametric Regression, J. Amer. Statist. Assoc., 88, 1287-1301.
[Eugster et al(2011)]Eugster2011 Eugster, M.J.A., Gertheiss, J. and Kaiser, S. (2011), Having the second leg at home: advantage in the UEFA Champions League knockout phase?, J. Quant. Anal. Sports, 7, 1.
[Flores et al(2015)]Flores2015 Flores, R., Forrest, D., de Pablo, C. and Tena, J. (2015), What is a good result in the first leg of a two-legged football match? European J. Oper. Res., 247, 641-647.
[Ghosh(1979)]Ghosh1979 Ghosh, B.K. (1979), A comparison of some approximate confidence intervals for the binomial parameter, J. Amer. Statist. Assoc., 74, 894-900.
[Hall(1992)]Hall1992 Hall, P. (1992), On bootstrap confidence intevals in nonparametric regression, Ann. Statist., 20, 695-711.
[Hall and Horowitz(2013)]Hall13 Hall, P. and Horowitz, J. (2013), A simple bootstrap method for constructing nonparametric confidence bands for functions, Ann. Statist., 41, 1892-1921.
[Härdle and Bowman(1988)]Hardle1988 Härdle, W.K. and Bowman, A.W. (1988), Bootstrapping in nonparametric regression: local adaptive smoothing and confidence bands, J. Amer. Statist. Assoc., 83, 102-110.
[Härdle et al(2004)]Hardle2004 Härdle, W.K., Müller, M., Sperlich, S. and Werwatz, A., Nonparametric and Semiparametric Models: an Introduction, Springer, 2004.
[Horowitz and Savin(2001)]Horowitz2001 Horowitz, J.L. and Savin, N.E. (2001), Binary response models: logits, probits and semiparametrics, J. Econ. Persp., 15, 43-56.
[Hurvich et al(1998)]Hurvich98 Hurvich, C.M., Simonoff, J.S. and Tsai, C.-L. (1998), Smoothing parameter selection in nonparametric regression using an improved Akaike information criterion, J. R. Stat. Soc. Ser. B Stat. Methodol., 60, 271-293. 
[Jamieson(2010)]Jamieson2010 Jamieson, J.P. (2010), The home field advantage in athletics: a meta-analysis, J. Appl. Soc. Psychol., 40, 1819-1848.

[Kassies(2016)]Kassies Kassies, B. (2016), UEFA European Cup Coefficients Database, http://kassiesa.home.xs4all.nl/bert/uefa/data/index.html.
[Köhler et al(2014)]Kohler14 Köhler, M., Schindler, A. and Sperlich, S. (2014), A Review and Comparison of Bandwidth Selection Methods for Kernel Regression, Int. Stat. Rev., 82, 243-274.
[le Cessie and van Houwelingen(1991)]Cessie91 le Cessie, S. and van Houwelingen, J.C. (1991), A goodness-of-fit test for binary regression models based on smoothing methods, Biometrics, 47, 1267-1282.
[Lidor et al(2010)]Lidor2011 Lidor, R., BarEli, M., Arnon, M. and BarEli, A.A. (2010), On the advantage of playing the second game at home in the knockout stages of European soccer cup competitions, International Journal of Sport and Exercise Psychology, 8, 312-325.
[Nadaraya(1964)]Nadaraya1964 Nadaraya, E.A. (1964), On estimating regression, Theory Probab. Appl., 9, 141-142.
[Neumann(1997)]Neumann1997 Neumann, M.H. (1997), Pointwise confidence intervals in nonparametric regression with heteroscedastic error structure, Statistics, 29, 1-36.
[Nevill and Holder(1999)]Nevill99 Nevill, A.M. and Holder, R.L. (1999), Home advantage in sport: an overview of studies on the advantage of playing at home, Sports Med., 28, 221-236.
[Olivier and May(2006)]Olivier2006 Olivier, J. and May, W.L. (2006), Weighted confidence interval construction for binomial parameters, Stat. Methods Med. Res., 15, 37-46.
[Page and Page(2007)]Page2007a Page, L. and Page, K. (2007), The second leg home advantage: evidence from European football cup competitions, J. Sports Sci., 25, 1547-1556.
[Pollard(1986)]Pollard1986 Pollard, R. (1986), Home advantage in soccer: a retrospective analysis, J. Sports Sci., 4, 237-248.
[Pollard(2006)]Pollard2006a Pollard, R. (2006), Home advantage in soccer: variations in its magnitude and a literature review of the inter-related factors associated with its existence, J. Sport Behav., 29, 169-189.[Pollard(2008)]Pollard2008 Pollard, R. (2008), Home advantage in football: a current review of an unsolved puzzle, Open Sports Sci. J., 1, 12-14.
[Pollard and Pollard(2005)]Pollard2005a Pollard, R. and Pollard, G. (2005), Long-term trends in home advantage in professional team sports in North America and England (1876-2003), J. Sports Sci., 23, 337-350.
[Rodríguez-Campos and Cao-Abad(1993)]Rodriguez93 Rodríguez-Campos, M.C. and Cao-Abad, R. (1993), Nonparametric bootstrap confidence intervals for discrete regression functions, J. Econometrics, 58, 207-222.

[Schwartz and Barsky(1977)]Schwartz1977 Schwartz, B. and Barsky, S.F. (1977), The home advantage, Social Forces, 55, 641-661.

[Wasserman(2006)]Wasserman2006 Wasserman, L., All of Nonparametric Statistics, Springer, 2006.
[Watson(1964)]Watson1964 Watson, G.S. (1964), Smooth regression analysis, Sankhya, 26, 359-372.
[Wilson(1927)]Wilson1927 Wilson, E. (1927), Probable inference, the law of succession, and statistical inference, J. Amer. Statist. Assoc., 22, 209-212.
[Xia(1998)]Xia98 Xia, Y. (1998), Bias-corrected confidence bands in nonparametric regression, J. R. Stat. Soc. Ser. B Stat. Methodol., 60, 797-811.




