The propagation of two orthogonally polarized shear waves, or shear-wave splitting, is arguably the most robust indication of seismic anisotropy in the Earth. This splitting can be parameterized in terms of the polarization of the fast shear-wave ϕ and the lag time between fast and slow components δt. These two parameters provide constraints on the mechanism causing the anisotropy. All methods of calculating splitting require a shear-wave analysis window to be selected. Then the ϕ and δt that best account for the splitting in that window are calculated. Conventionally the shear-wave analysis window is picked manually. However, manual window selection is laborious and also very subjective; in many cases different windows give very different results. We present a method for automating the selection of the window. First, the splitting analysis is performed for a range of window lengths. Then a cluster analysis is applied in order to find those measurements that are stable over many different windows. Once clusters of stable results have been found, the final choice of shear-wave analysis window corresponds to the measurement with the lowest error in the cluster with the lowest variance. Resulting estimates of ϕ and δt are objective, and very large datasets can be analyzed easily. The success of the technique is illustrated with application to a microseismic dataset of 324 events, which confirms previously published results using manually selected analysis windows.