The invention discloses a multivariate linear regression algorithm applied to cost analysis, belonging to the technical field of cost analysis, comprising the following steps: establishing a database,subdividing, sorting and classifying the cost of raw materials, electricity and gas, consumption of office supplies, wages of workers, cost of fixed assets consumption, etc.; The data in the databaseare substituted into the multiple linear regression equation, and the basis of data analysis is established. Establish a description of data sources, both external and internal; Through the model calculation and analysis process and model results, the model results include observation value, index value, prediction value, residual and standard residual; The method includes regression statistics,variance analysis and regression parameter table. The invention uses multiple linear regression as an analysis tool to study the relationship between each main cost and the total cost, and reasonablyanalyze and predict the total cost according to the variation trend between the consumption amount of each unit cost and the total cost.