One of the most common problems for warehouse management is the spare parts stock planning to cover the repair and maintenance needs of medical equipment. At the Center for Clinical and Electro Engineering, the planning of spare parts for maintenance and replacement is carried out through reports issued by electromedical who work the health areas of the country. Nowadays the recorded information, plus expert judgment is not enough for carrying out an optimum planning that would supply the correct amount of parts demanded, in an adequate period of time. Taking into account these insufficiencies this paper presents an algorithm that allows the optimization of the stock of spare parts for medical equipment. For its conformation, statistics estimation techniques were used: Stratified Random Sampling, Correlation and Simple Linear Regression