Hello everyone,
I want to learn if it is possible to generate new observations in the same variables with using the existing variables.
Assume the following example: Time series data from 1980-2022 and the variable for the years is "Year" and there is "Month" variable 1-12 for each year. Now further assume that we have variables var_1........var_20 .
I want to create 2023 under the year with 12 observation 1-12 under month. and for all the other variables var_1....var_20 I want to generate the values as the sum of values from 2009 and 2010. I thought it should be something like that.
Of course such code does not exist and does not work I gave it as an indication to make my question more understandable. Is it possible to do that. I can do it in new variable but I have no idea how can I generate new observations from the existing observations. This example is just for the general case. I have not seen any related topic before so if there are please inform me so that I will follow that topic.
I want to learn if it is possible to generate new observations in the same variables with using the existing variables.
Assume the following example: Time series data from 1980-2022 and the variable for the years is "Year" and there is "Month" variable 1-12 for each year. Now further assume that we have variables var_1........var_20 .
I want to create 2023 under the year with 12 observation 1-12 under month. and for all the other variables var_1....var_20 I want to generate the values as the sum of values from 2009 and 2010. I thought it should be something like that.
Code:
gen obs(2023) = if Year==2009 + if Year=2010
Comment