We performed a retrospective analysis to establish a statistical model for the prediction of Pneumocystis pneumonia (PCP) in patients with connective tissue diseases (CTD) undergoing medium- or high-dose corticosteroid therapy, to identify independent risk factors for PCP and to evaluate the efficacy of the prophylactic use of trimethoprim-sulfamethoxazole (TMP/SMX) against PCP. One hundred and twenty-four patients who were receiving the equivalent of or more than 30 mg/day of prednisol-one (PSL) were classified into two groups according to the presence (prophylaxis group, n = 46) or absence (nonprophylaxis group, n = 78) of prophylactic TMP/SMX. We developed a statistical model that was suitable for predicting the development of PCP using a logistic regression analysis. The initial steroid dosage, decreased peripheral blood lymphocyte counts at 2 weeks (<500/microl), and usage of immunosuppressant during 2 weeks after the institution of PSL (>or=30 mg/day) were found to independently contribute to the development of PCP. Finally, in the patient group with a defined risk for PCP, a significant prophylactic effect of TMP/SMX was demonstrated. We recommend the prophylactic use of TMP/SMX for patients with CTD undergoing medium- or high-dose corticosteroid therapy who are determined to have a high risk of developing PCP.