Dear Stata-users,
I am dealing with multiple large datasets from various excel files requiring repeated matching / append processes. Here, in this case, I have a file A with two string variables var1 with names (string) and var2 with descriptions (string), as below:
var1 (COLUMNNAME) ------ var2 ( COLUMNDESC)
1. MCS21 ------ Please specify ~ Eyes
2. MNPDSP2 ------ Please specify ~ Operator
3. MBBPS11 ------ Lipid Laden macrophages
etc , etc
Also, I have a file B and a file C with different data and variables that are no labelled, however their labels are in the file-A
e.g. file-B: MCS21 str48 %48s (unlabelled)
e.g. file-C: MBBPS11 str48 %48s (unlabelled)
My task is to instruct Stata using a loop to identify the varnames in file A (as in column var1 ) and attached the correct variable labels (as in column var2 ) into the variables of the files B and C.
Any idea how this should be done?
Thank you in advance
George
I am dealing with multiple large datasets from various excel files requiring repeated matching / append processes. Here, in this case, I have a file A with two string variables var1 with names (string) and var2 with descriptions (string), as below:
var1 (COLUMNNAME) ------ var2 ( COLUMNDESC)
1. MCS21 ------ Please specify ~ Eyes
2. MNPDSP2 ------ Please specify ~ Operator
3. MBBPS11 ------ Lipid Laden macrophages
etc , etc
Also, I have a file B and a file C with different data and variables that are no labelled, however their labels are in the file-A
e.g. file-B: MCS21 str48 %48s (unlabelled)
e.g. file-C: MBBPS11 str48 %48s (unlabelled)
My task is to instruct Stata using a loop to identify the varnames in file A (as in column var1 ) and attached the correct variable labels (as in column var2 ) into the variables of the files B and C.
Any idea how this should be done?
Thank you in advance
George
Comment