Hi everyone,
I would like to create a database which contain all informations about some prudential measures which have been implemented by prudential authorities. The original database describe each measure, one per row.
This is a short sample of what I have so far:
Here, the first row tell us that this measure is a type 1 measure in France. It was announced in January 1991, and then implemented in March 1991. This measure applied to the whole country ("national" is a dummy which take a value of 1 if the measure is national).
I have been asked to do this transformation:
Here, "." are not missing values, it's more a "and so on". In addition, I only entered few variables, but there is more of them.
With this format, we will have a variable "Date", which is the time variable (1991m1 to 2018m12).
All of the variables except "Date" are dummies. For example, "FR_T1_ANN_NA" = 1 give us the same information as the first row of the first database that I described. The only difference is that we only have the announcement of the measure, so we need to give a value of 1 for FR_T1_INF_NA in 1991m3 as well ("FR" = France, "T1" = type 1 instrument, "INF" = In force", "NA" = national"). In the end, there will be a huge number of variables, because each one describe a specific measure.
So the idea is to interact all variables related to prudential measures, in order to keep all information.
In addition, I would like to know if it is possible to name these variables automatically, in a way that I will know what they mean, such as "FR_T1_ANN_NA".
I know the command
but that would give me names such as "variable1", "variable2", "variable3" etc.
If anybody has an idea if and how this can be achieved, I would be very grateful.
I would like to create a database which contain all informations about some prudential measures which have been implemented by prudential authorities. The original database describe each measure, one per row.
This is a short sample of what I have so far:
Code:
clear input str2 country str6 announce_date type str6 inforce_date national FR 1991m1 1 1991m3 1 FR 1991m4 1 1991m5 1 ES 1992m4 2 1992m5 1 ES 1992m6 1 1992m6 0 end
I have been asked to do this transformation:
Code:
clear input str6 Date FR_T1_ANN_NA ES_T1_ANN_NA FR_T2_ANN_NA ES_T2_ANN_NA FR_T1_INF_NA 1991m1 1 0 0 0 0 1991m2 0 0 0 0 0 1991m3 0 0 0 0 1 1991m4 1 0 0 0 0 1991m5 0 0 0 0 1 1991m6 . . . . . 1991m7 . . . . . 1991m8 . . . . . 1991m9 . . . . . 1991m10 . . . . . 1991m12 . . . . . 1992m1 . . . . . 1992m2 . . . . . 1992m3 . . . . . 1992m4 . . . . . 1992m5 . . . . . 1992m6 . . . . . end
With this format, we will have a variable "Date", which is the time variable (1991m1 to 2018m12).
All of the variables except "Date" are dummies. For example, "FR_T1_ANN_NA" = 1 give us the same information as the first row of the first database that I described. The only difference is that we only have the announcement of the measure, so we need to give a value of 1 for FR_T1_INF_NA in 1991m3 as well ("FR" = France, "T1" = type 1 instrument, "INF" = In force", "NA" = national"). In the end, there will be a huge number of variables, because each one describe a specific measure.
So the idea is to interact all variables related to prudential measures, in order to keep all information.
In addition, I would like to know if it is possible to name these variables automatically, in a way that I will know what they mean, such as "FR_T1_ANN_NA".
I know the command
Code:
tab variable, gen(variable)
If anybody has an idea if and how this can be achieved, I would be very grateful.
Comment