Dear Stata-users,
I have a panel data strongly balanced. I have generated a new variable to calculate the growth rate of the variable "x":
bys id: gen x_growth= (x[_n]-x[_n-1])/x[_n-1]
After i would like to drop the outliers. I'm using the following code:
drop if x_growth < r(p1) | x_growth > r(p99)
Nevertheless, by using this code, all of my missing values for this variable are dropped but i would like to keep these missing values.
Thank you in advance,
Pierre
I have a panel data strongly balanced. I have generated a new variable to calculate the growth rate of the variable "x":
bys id: gen x_growth= (x[_n]-x[_n-1])/x[_n-1]
After i would like to drop the outliers. I'm using the following code:
drop if x_growth < r(p1) | x_growth > r(p99)
Nevertheless, by using this code, all of my missing values for this variable are dropped but i would like to keep these missing values.
Thank you in advance,
Pierre
Comment