Hello!
I am currently writing my master thesis on the implementation of GSCMP on financial performance. To evaluate the effect on financial performance one year later I want to lag my independent variable with one year. However, I only want to include observations that have at least two year of consecutive data available, I used the command indicated below. My initial dataset contains 8508 observations over a 10 year time period (2006-2015). I was wondering how to treat these 1436 generated missing values when doing my regression analyses, should I delete them or what is regular procedure when creating lagged variables?
. xtset ID year
panel variable: ID (unbalanced)
time variable: year, 2006 to 2015, but with gaps
delta: 1 unit
. by ID: gen L1 = GSCMP[_n-1] if year==year[_n-1]+1
(1436 missing values generated)
thank you in advance
Related Posts with treating missing values due to lagged variable creation
Dates from Excel/CSV not correctly displaying in StataI imported several csv files with "birthdate" as one of the variables into Stata and then I appended…
division of two-column using if functionHello, I have this dataset, and I want to divide CLMS18/CLMS17 if NPI17 is the same as NPI18 and the…
Block bootstrapping panel: Unable to generate new variable using each bootstrap replicationtsset firm wave xtabond2 y L LL K LK Ly dum2 dum3 wood1 textile1 metal1 anystat anyfor capcity, gmm …
Limiting panel data regression to groups with at least 10 consecutive observationDear all, The following is my sample data. Could you please help how I can run panel data regressio…
What is wrong with inlist2 in my code?Hi all, Yesterday, as documented from this post (https://www.statalist.org/forums/for...p-of-countr…
Subscribe to:
Post Comments (Atom)
0 Response to treating missing values due to lagged variable creation
Post a Comment