INTRODUCTION: Bayesian data mining methods have been used to evaluate drug safety signals from adverse event reporting systems and allow for evaluation of multiple endpoints that are not prespecified. Their adaptation for use with longitudinal data such as administrative claims has not been previously evaluated or validated. METHODS: In this pilot study, we evaluated the feasibility of adapting data mining methods using the empirical Bayes Multi-item Gamma Poisson Shrinkage (MGPS) algorithm to longitudinal administrative claims data. The Medicare Current Beneficiary Survey was used to identify a cohort of Medicare enrollees who were exposed to cyclooxygenase selective (coxib) or nonselective nonsteroidal anti-inflammatory drugs (NS-NSAIDs) from 1999 to 2003. Empirical Bayes MGPS algorithm was used to simultaneously evaluate 259 outcomes associated with current use of coxibs versus NS-NSAIDs while adjusting for key covariates and multiple comparisons. For comparison, a parallel analysis used traditional epidemiologic methods to evaluate the relationship between coxib versus NS-NSAID use and acute myocardial infarction, with the goal of establishing the concurrent validity of the data mining approach. RESULTS: Among 9431 Medicare beneficiaries using NSAIDs and considering all 259 possible outcomes, empirical Bayes MGPS identified an association between current celecoxib use and acute myocardial infarction (Empirical Bayes Geometric Mean ratio 1.91) but not other outcomes. Rofecoxib use was associated with acute cerebrovascular events (Empirical Bayes Geometric Mean ratio 1.85) and several other diagnoses that likely represented indications for the drug. Results from the analyses using traditional epidemiologic methods were similar and indicated that the data mining results were valid. DISCUSSION: Bayesian data mining methods seem useful to evaluate drug safety using administrative data. Further work will be needed to extend these findings to different types of drug exposures and to other claims databases.