I was treating the outliers in the variable of a dataset with 614 observations. But I can't manage to write code.
I was working on a dataset with 614 observations and due to some reason don't want to trim it in response to treat the variables. I want any value greater than the 91st percentile to be equal to the 91st percentile without reducing the number of observations.
In simple words, I want to replace all values above 10171.5 (91st percentile) with 10171.5.