Hello.
I am participating in a recruitment process where I have been given a dataset with around 370 variables and a txt with the output of the command codebook.
The problem is that the dataset came without the variables' lables. However, the variables' names where included in the codebook output txt file they sent me. It seems like they had a dataset with the variables' labels, they ran the command codebook and then erased the variables' labels in order to send me.
Is there a way I would import the codebook output in txt as a dictionary so that I can have the variables labeled in my dataset?
Many thanks
Below I provide an example of my dta and txt files:
The dta
The txt containing the output of the command codebook.
I am participating in a recruitment process where I have been given a dataset with around 370 variables and a txt with the output of the command codebook.
The problem is that the dataset came without the variables' lables. However, the variables' names where included in the codebook output txt file they sent me. It seems like they had a dataset with the variables' labels, they ran the command codebook and then erased the variables' labels in order to send me.
Is there a way I would import the codebook output in txt as a dictionary so that I can have the variables labeled in my dataset?
Many thanks
Below I provide an example of my dta and txt files:
The dta
Code:
. des
Contains data
obs: 321
vars: 377
size: 1,429,413
---------------------------------------------------------------------------------------------------------
storage display value
variable name type format label variable label
---------------------------------------------------------------------------------------------------------
Savsg1c6_1 str27 %27s
Savsg1c6_2 str26 %26s
Savsg1c6_3 str26 %26s
Savsg1c6_4 byte %8.0g
Savsg1c6_5 byte %8.0g
Savsg1c6_6 byte %8.0g
Savsg1c6_7 byte %8.0g
Savsg1c6_8 byte %8.0g
The txt containing the output of the command codebook.
Code:
Savsg1c6_1 Where would you save the amount of money? (#1/8)
--------------------------------------------------------------------------------------
type: numeric (byte)
label: save
range: [1,8] units: 1
unique values: 7 missing .: 110/231
tabulation: Freq. Numeric Label
10 1 In a safe place in my house
38 2 In a bank account
67 3 In my mobile money account
2 4 In my Kibubu box
1 5 In a chama
2 7 In a VICOBA
1 8 Other
110 .
--------------------------------------------------------------------------------------
Savsg1c6_2 Where would you save the amount of money? (#2/8)
--------------------------------------------------------------------------------------
type: numeric (byte)
label: save
range: [2,7] units: 1
unique values: 4 missing .: 218/231
tabulation: Freq. Numeric Label
2 2 In a bank account
9 3 In my mobile money account
1 4 In my Kibubu box
1 7 In a VICOBA
218 .
--------------------------------------------------------------------------------------
Savsg1c6_3 Where would you save the amount of money? (#3/8)
--------------------------------------------------------------------------------------
type: numeric (byte)
label: save
range: [3,3] units: 1
unique values: 1 missing .: 230/231
tabulation: Freq. Numeric Label
1 3 In my mobile money account
230 .
--------------------------------------------------------------------------------------
Savsg1c6_4 Where would you save the amount of money? (#4/8)
--------------------------------------------------------------------------------------
type: numeric (byte)
label: save
range: [.,.] units: .
unique values: 0 missing .: 231/231
tabulation: Freq. Numeric Label
231 .
--------------------------------------------------------------------------------------
Savsg1c6_5 Where would you save the amount of money? (#5/8)
--------------------------------------------------------------------------------------
type: numeric (byte)
label: save
range: [.,.] units: .
unique values: 0 missing .: 231/231
tabulation: Freq. Numeric Label
231 .
--------------------------------------------------------------------------------------
Savsg1c6_6 Where would you save the amount of money? (#6/8)
--------------------------------------------------------------------------------------
type: numeric (byte)
label: save
range: [.,.] units: .
unique values: 0 missing .: 231/231
tabulation: Freq. Numeric Label
231 .
--------------------------------------------------------------------------------------
Savsg1c6_7 Where would you save the amount of money? (#7/8)
--------------------------------------------------------------------------------------
type: numeric (byte)
label: save
range: [.,.] units: .
unique values: 0 missing .: 231/231
tabulation: Freq. Numeric Label
231 .
--------------------------------------------------------------------------------------
Savsg1c6_8 Where would you save the amount of money? (#8/8)
--------------------------------------------------------------------------------------
type: numeric (byte)
label: save
range: [.,.] units: .
unique values: 0 missing .: 231/231
tabulation: Freq. Numeric Label
231 .

Comment