# Which is the correct method for outlier analysis on a dataset for modelling?

I'm trying to build a regression model but my data-set have many outliers points which I need to analyze and then remove them.

There are two ways to do it,

1) First do all the analysis on every feature without removing anything and then finally remove them at last based on the condition we got from doing the analysis.

2) Do analysis on first feature then remove outliers, then do analysis on second feature then remove outliers.... In this manner one after other.

The insights gained from first method differs from second method.

Which is the correct way?

Welcome to the forum! One of the most common approaches to outlier detection is via Cook's distance. Usually you should perform regression on all features you want to consider, since you do not know ex-ante how they perform jointly in a regression. The reason is that you map single features $$x_1, ..., x_n$$ in an Euclidean space when you do multivariate regression and you are interested in the "importance" of certain observations in this space (and not as an isolated feature).