Researchers and practitioners have used industry classification systems (e.g., SIC) to select peer firms and create an evaluation benchmark. However, we argue that the choice of peer firms should depend on the research goals. A single peer selection method is not adequate in all circumstances. This study provides a novel approach that yields flexible groupings of firms using clustering techniques. We select the set of financial ratios related to a particular research objective and apply K-medians clustering to identify peer firms. In the subsequent year, a new variable is constructed to capture firms' deviation from peer firms. Significant deviations between a firm and its peers may indicate potential anomalies. We evaluate the usefulness of this K-medians clustering-based peer selection approach by incorporating this variable into a misstatement detection model and a bankruptcy prediction model and find that information about the clustering-based peers can enhance the performance of existing models.