I want to define the value label of the variable wave in a panel dataset.
For this, I define the values:
I want to write this flexibly, such that the code can be adapted to other HRS-type surveys.
For this, I do
Where I want the local -wavelabellist- to be defined as " 1 "Wave 1" 2 "Wave 2" 3 "Wave 3" 4 "Wave 4" 5 "Wave 5" ".
However, this combines a set of numbers, 1,2,3,4,5 with a set of strings "wave 1" ... "wave 5".
I tried the following:
But this does not work, because wavelabellist seems to end the local at the first ", i.e. before the first Wave.
Is it possible to combine 1 and "wave" into a local, whereby the quotation (") shall be kept into the local?
For this, I define the values:
HTML Code:
la define wavel 1 "Wave 1" 2 "Wave 2" 3 "Wave 3" 4 "Wave 4" 5 "Wave 5" la values wave wavel
For this, I do
HTML Code:
la define wavel `wavelabellist'
However, this combines a set of numbers, 1,2,3,4,5 with a set of strings "wave 1" ... "wave 5".
I tried the following:
HTML Code:
loc wavelast "5" forvalues i=1/`wavelast'{ loc wavelabellist `" `wavelabellist' `i' "wave" "' } di "`wavelabellist'"
Is it possible to combine 1 and "wave" into a local, whereby the quotation (") shall be kept into the local?
Comment