We consider the problem of choosing, from a set of N potential stock-keeping units (SKUs) in a retail category, K SKUs to be carried at each store to maximize revenue or profit. Assortments can vary by store, subject to a maximum number of different assortments. We view a SKU as a set of attribute levels and also model possible substitutions when a customer's first choice is not in the assortment. We apply maximum likelihood estimation to sales history of the SKUs currently carried by the retailer to estimate the demand for attribute levels and substitution probabilities, and from this, the demand for any potential SKU, including those not currently carried by the retailer. We specify several alternative heuristics for choosing SKUs to be carried in an assortment. We apply this approach to optimize assortments for three real examples: snack cakes, tires, and automotive appearance chemicals. A portion of our recommendations for tires and appearance chemicals were implemented and produced sales increases of 5.8% and 3.6%, respectively, which are significant improvements relative to typical retailer annual comparable store revenue increases. We also forecast sales shares of 1, 11, and 25 new SKUs for the snack cake, tire, and automotive appearance chemical applications, respectively, with mean absolute percentage errors (MAPEs) Fader and Hardie (1996).