Dear Rstudio Community members,

I have a probably very simple question, but I am still very new to Rstudio.

My data looks like this:

y x

7 0

23 1

0 1

222 0

and so on..

Now I would like to run a simple linear regression, but I would like to omit the highest and the lowest 1% of the variable y, i.e. censor the top and bottom 1%.

I tried to use the winsorize command from the RobustHD package. But somehow the linear regression [ lm(..) ] seems to ignore my command, probably I make a mistake.

Could someone please, through an example, show me how to do this?