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
Interpretation of the following regression resultHi Statalist, I used the following code Code: areg grade shock#c.months_exposure#c.treatment_inten…
graph using foreachHi I am producing some graphs having used Code: foreach My combined graph is a 3x3 plot (3 columns …
"putexcel save" Error: SAVE: invalid cell nameHello! I am trying to output tables in excel with this code: putexcel set "${path_results}\\`sc'_$…
barchart: how to put the frequency axis on a log scaleDear all: I have a categorical variable with vastly unequal frequencies. I would like to display th…
getting putdocx to change the display format to %12.0fcDear Statalisters, could you please help with a conundrum I have not been able to resolve myself. …
Subscribe to:
Post Comments (Atom)
0 Response to Setting panel data observations to same baseline
Post a Comment