Dear Stata users,
I would like to ask your help. I have a numeric variable named "nmf" and a string variable named "nmf_str".
I want to replace the value of the numeric variable at index 5 with the value of the string variable at the same index.
The numeric variable contains names of funds that I previously converted to a numeric format.
The string variable only contains a value at index 5.
My code is the following:
. local new_value = real(nmf_str[5])
. replace nmf = `new_value' in 5
(1 real change made, 1 to missing)
In the data editor the previous value of the numeric variable at index 5 is now a missing value.
I very much appreciate any help!
Best,
Chwen Chwen
I would like to ask your help. I have a numeric variable named "nmf" and a string variable named "nmf_str".
I want to replace the value of the numeric variable at index 5 with the value of the string variable at the same index.
The numeric variable contains names of funds that I previously converted to a numeric format.
The string variable only contains a value at index 5.
My code is the following:
. local new_value = real(nmf_str[5])
. replace nmf = `new_value' in 5
(1 real change made, 1 to missing)
In the data editor the previous value of the numeric variable at index 5 is now a missing value.
I very much appreciate any help!
Best,
Chwen Chwen
Comment