As an increasing number of data is to be processed, outsourcing data to the cloud environment becomes an appealing proposal to heighten the computation/storage efficiency, while avoiding costly and complicated system construction. However, it is necessary to encrypt the outsourced data to prevent the breaches of both data confidentiality and privacy. Most of the statistical procedures deal with the data in the cleartext form, making it hard to directly apply them to the data in the encrypted form. In this paper, we present a statistical framework to securely and efficiently obtain the statistics on encrypted cloud data through real-time processing. We build our framework on top of the searchable public-key encryption and provide detailed transformation of the statistical procedures for the plain data to those for the encrypted data. We provide detailed descriptions and examples of these transformed statistical procedures. Finally, we provide security analysis and performance evaluation of these transformed procedures and demonstrate the effectiveness and efficiency of the proposed framework.