Hello Everyone,
I am currently working with a rather lagre Panel Dataset (n = 35000, 15 waves, ~400 Variables per Wave). The dataset is in a wide format so I want to reshape into long.
The problem is the names of the variables. They follow this scheme: kpX_1234
kpX is the prefix to determine the Wave number. Whereas the four following numbers identify the specific variable.
I tried reshaping with the following code:
reshape long kp1 kp2 kp3 ... kpX, i(id) j(wave)
But this creates a subobservation identifier (j) for every variable due to the way the variables are named. Due to the volume of Variable I would obviously like to avoid having to enter them all individually.
I thought about changing the variable names to 1234_kpX but this would still leave me having to enter every variable at a time.
Is there any quick way of reshaping the dataset?
Thank you,
Julian
I am currently working with a rather lagre Panel Dataset (n = 35000, 15 waves, ~400 Variables per Wave). The dataset is in a wide format so I want to reshape into long.
The problem is the names of the variables. They follow this scheme: kpX_1234
kpX is the prefix to determine the Wave number. Whereas the four following numbers identify the specific variable.
I tried reshaping with the following code:
reshape long kp1 kp2 kp3 ... kpX, i(id) j(wave)
But this creates a subobservation identifier (j) for every variable due to the way the variables are named. Due to the volume of Variable I would obviously like to avoid having to enter them all individually.
I thought about changing the variable names to 1234_kpX but this would still leave me having to enter every variable at a time.
Is there any quick way of reshaping the dataset?
Thank you,
Julian

Comment