Hello,

I want to perform xtreg, fe on a panel dataset with lagged independent variables (1, 2 and 3 lags), while the dependent variable is not lagged. However, there are a lot of missing values in my dataset. Therefore I want to delete the observations that were not used in the regression and winsorize the remaining ones. I only have data for my dependent variable for 2014-2018, but for the independent variable, my data goes from 2010 to 2018. When I use
Code:
gen var = e(sample)
only observations from 2014-2018 are marked, so when I drop all zeroes, the lags are dropped too. So I want to obtain that all observations used in the sample are kept in the sample, together with their lagged observations. Could somebody help me, please?

Kind regards,
Timea De Wispelaere