0
$\begingroup$

What I often do is that I check boxplots and histograms for target/dependent variable and after much caution, treat/remove the outliers. But this is what I do only for the target variable. I.e., if considered the removal, I'd simply drop the entire row where my target value was found outlying.

Suppose if I am having outliers in some independent variables as well. What should I do there?

Either,

  1. Should I ignore them?

Or,

  1. Should I take the same approach with Independent variables as I took with the target variable?

EDIT: Take the following example. Assume that we are predicting the expenditure of customers target_expenditure_USD. Other variables are Independent Variables

age sex last_purchase target_expenditure_USD
34 M 12-02-2020 520,000
24 F 02-06-2019 2,234
43 F 10-08-2018 4,365
130 M 23-07-2020 1,424
45 F 12-01-1839 6,453

Thanks

$\endgroup$
8
  • 1
    $\begingroup$ How do you know they are outliers? $\endgroup$ Nov 4, 2021 at 11:15
  • $\begingroup$ Assume if they are outliers. How should be they treated? i-e, in my independent variables as well $\endgroup$
    – letdatado
    Nov 4, 2021 at 11:21
  • 1
    $\begingroup$ You shouldn't assume. If you are to edit your data you better have a good reason for doing so, otherwise you are better off using a robust model which is not susceptible to outliers. $\endgroup$ Nov 4, 2021 at 11:22
  • $\begingroup$ I have given an example. Check it. It is a pretty naive attempt of creating an example haha. But suppose if I have such case $\endgroup$
    – letdatado
    Nov 4, 2021 at 11:28
  • 1
    $\begingroup$ The point is that if you do not know the context of the data it is hard to tell what is "right" and what is "wrong". For your data, that poor soul who spent 520k dollars could have bought a house, hence the high expenditure. How would you know about this? If you were to remove this value and it was valid you would be biasing your data and results. If this was expenditure on candies you may reasonably well assume that it is indeed probably wrong, in that case, if your data allows it, drop the whole row, rather than changing the data. $\endgroup$ Nov 4, 2021 at 11:37

1 Answer 1

1
$\begingroup$

Continuing from the comments.

You should inspect all variables for outliers, not just your dependent variable (y). And if you find any outliers then you should do something about it.

If you are certain that they are in fact erroneous measurements then ideally you would drop the whole row. If, however, you cannot determine that (and it doesn't look like it) then you shouldn't just drop them or change them, but rather it would be better to keep your data as-is, maybe mention the weird values, and use robust models when analyzing your data, that is models which are robust to outliers.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.