Hello Statalist,
I would like to do trimming to ignore the outliers. The trimming for observations (return) would in the top or bottom 0.1%. I use the command as following:
Code:
gen returntrim=return if return>=r(p 0.1) & return<=r(p 99.9)
However, I got this error result:
p0.1 invalid name
r(198);
When I try for the top or bottom 1%, I succeed.
Code:
gen returntrim=return if return>=r(p1) & return<=r(p99)
Does anyone know why it has happened? Does the trimming is only for the percentile starting from 1%?
I would appreciate the kind help and comment.
Thank you.
Regards,
Rozita
I would like to do trimming to ignore the outliers. The trimming for observations (return) would in the top or bottom 0.1%. I use the command as following:
Code:
gen returntrim=return if return>=r(p 0.1) & return<=r(p 99.9)
However, I got this error result:
p0.1 invalid name
r(198);
When I try for the top or bottom 1%, I succeed.
Code:
gen returntrim=return if return>=r(p1) & return<=r(p99)
Does anyone know why it has happened? Does the trimming is only for the percentile starting from 1%?
I would appreciate the kind help and comment.
Thank you.
Regards,
Rozita
Comment