We developed an algorithm, using recursive partitioning, that utilized information from a computerized, diagnostic database to predict the diagnosis of osteoarthritis as determined by medical record review. The complete (inpatient and outpatient) medical records for a random sample of 400 Olmsted County, Minnesota residents with a database diagnosis consistent with osteoarthritis were reviewed, and confirmation or rejection of the diagnosis was accomplished. Of the 387 patients in our sample, only 232 (a positive predictive value of 60%) fulfilled diagnostic criteria for osteoarthritis following medical record review. A classification tree was created that used information from the diagnostic database to partition the study population according to the proportion of individuals with a "true" diagnosis of osteoarthritis (based on medical record review). The receiver-operating characteristic curve generated from these data illustrated that the algorithm substantially improved the validity of the database diagnosis, yielding a positive predictive value of 89% and a negative predictive value of 70% (sensitivity of 75% and specificity of 86%) at a selected cutoff point. This model also provides the capability of selecting the cutoff point to favor either specificity or sensitivity. These data demonstrate that a mathematical model can substantially improve the validity of computerized diagnostic databases in osteoarthritis.