hello,
I'm working with panel data/time-series data.
I tried to calculate the change one one variable from one year to another.
I used the following code:
.tsset
panel variable: EntityName_n (unbalanced)
time variable: Year, 1986 to 2012, but with gaps
delta: 1 year
.generate ShortTermDebtChange = D.RatioShortDebtTotalAssets
and for another try I used the following Code:
.sort EntityName_n Year
.gen chgShortDebtnew = RatioShortDebtTotalAssets[Year]-RatioShortDebtTotalAssets[Year-1] if EntityName_n[Year]==EntityName_n[Year-1]
Can somebody explain what's the difference between both approaches since I get different results.
Thanks in advance
I'm working with panel data/time-series data.
I tried to calculate the change one one variable from one year to another.
I used the following code:
.tsset
panel variable: EntityName_n (unbalanced)
time variable: Year, 1986 to 2012, but with gaps
delta: 1 year
.generate ShortTermDebtChange = D.RatioShortDebtTotalAssets
and for another try I used the following Code:
.sort EntityName_n Year
.gen chgShortDebtnew = RatioShortDebtTotalAssets[Year]-RatioShortDebtTotalAssets[Year-1] if EntityName_n[Year]==EntityName_n[Year-1]
Can somebody explain what's the difference between both approaches since I get different results.
Thanks in advance
Comment