Hello,
I have panel data for arrivals in 116 municipalities from 1960-2018.
I want to generate the additional change of arrivals in each year to the base year 1960 for each municipality. I want the value in 1960 set to a baseline of 1 or 100 for each municipality so that each have the same initial baseline level.
Which should be: g = nt / nt=1960 t= 1960,....,2018
I used:
. gen arr_n=(arrivals[_n]/arrivals[_cons])
For the municipality m_id 1, the value is set to 1 for 1960 and it calculates right from there but it doesn't set to 1 for 1960 in the m_id 2.
How can I tell Stata to always start the calculation new when the year is 1960?
And second issue, some observations are missing in 1960. Should I rather drop this year and start from 1961 or is there another possibility to account for this.
Thank you very much!
Luis
Related Posts with Setting panel data observations to same baseline
Ceo pay sliceDear Stata Community, I need your guidance in calculating the CEO PAY SLICE (CPS) proposed by Bebchu…
Reverse a numeric variableHi all, so i have a numeric variable with a lot of values, that are decimal: 4,626276 5,162374 5,6…
mi impute chained trace plotsHi all, I am running the command mi impute chained (regress) x y z = a b c, add (10) burnin (100) r…
Help merging excel files in stata with 3 variablesI have 3 excel files with poverty data at the county level for the years 1980,1990, and 2000. I have…
Reversion mean after overreactionsI'm studying overreactions in the BVSP index and I need to check if after these reactions the return…
Subscribe to:
Post Comments (Atom)
0 Response to Setting panel data observations to same baseline
Post a Comment