Does correcting the data analysis when replying to a Major Revision make a bad impression on the editors and reviewers? I received a decision on my manuscript, requiring Major Revisions. One referee thinks one of my result is abnormal and contradictory with previous findings.

After checking my raw data and analysis and I found I did make a big mistake about the calculation. I know my carelessness brought the confusion to the referees and editors and I will explain this carefully in the cover letter when submitting the revised manuscript.  

But I am also worried that the manuscript will be rejected even if I correct this mistake, because one mistake may make them stop trusting my research. How do editors and reviewers typically react to major changes in analysis?
Part of the point of peer review is to help correct errors before they’re published. Acknowledging that you made an error isn’t a sign of weakness, or at least shouldn’t be viewed as such, instead, it should be a sign that you are a person interested in making work that is done correctly.

A reviewer on my very first paper pointed out that one of my graphs had to be incorrect, because it violated an important principle. It turned out the reviewer was correct. I had made a math error in the code that generated the graph. I fixed it and resubmitted it, and there were no further issues.

Don’t worry about the impressions of the peer reviewers—focus on making your papers as strong and as accurate as possible.