We propose an empirical framework for analyzing the macroeconomic effects of quantitative easing (QE) and apply it to Japan. The framework is a regime‐switching structural vector autoregression in which the monetary policy regime, chosen by the central bank responding to economic conditions, is endogenous and observable. QE is modeled as one of the regimes. The model incorporates an exit condition for terminating QE. We find that higher reserves at the effective lower bound raise inflation and output, and that terminating QE may be contractionary or expansionary, depending on the state of the economy at the point of exit.