Almost Similar Tests for Mediation Effects and other Hypotheses with Singularities * Kees Jan van Garderen Amsterdam School of Economics University of Amsterdam K.J.vanGarderen@uva.nl Noud van Giersbergen Amsterdam School of Economics University of Amsterdam N.P.A.vanGiersbergen@uva.nl First Version: February, 2020 Abstract Testing for mediation effects is empirically important and theoretically interesting. It is important in psychology, medicine, economics, accountancy, and marketing for instance, generating over 90,000 citations to a single key paper in the field. It also leads to a statistically interesting and long-standing problem that this paper solves. The no-mediation hypothesis, expressed as H 0 : θ 1 θ 2 = 0, defines a manifold that is non-regular in the origin where rejection probabilities of standard tests are extremely low. We propose a general method for obtaining near similar tests using a flexible g- function to bound the critical region. We prove that no similar test exists for mediation, but using our new varying g-method obtain a test that is all but similar and easy to use in practice. We derive tight upper bounds to similar and nonsimilar power envelopes and derive an optimal test. We extend the test to higher dimensions and illustrate the results in a trade union sentiment application. Keywords: Varying g-method, Mediation, Indirect Effect, Power Envelope, Similar Tests, Invariant Tests, Optimal Tests * The authors thank Isaiah Andrews, Tim Armstrong, Peter Boswijk, Geert Dhaene, James Duffy, Jean- Marie Dufour, Patrik Guggenberger, Grant Hillier, Max King, Gael Martin, Sophocles Mavroeidis, Geert Mesters, Frank Kleibergen, Anna Mikusheva, Ulrich M¨ uller, Bent Nielsen, Adam McCloskey, Peter Phillips, Mikkel Plagborg-Møller, Richard Smith, Frank Windmeijer, Tiemen Woutersen and other participants at seminars at the University of Oxford, Monash University, KU Leuven, University of Amsterdam, and the conferences Advances in Econometrics 2018 in London, ANZESG2019 in Wellington, and (EC) 2 2019 in Oxford. 1 arXiv:2012.11342v1 [econ.EM] 21 Dec 2020