Hi everyone!
Currently I'm working on a dataset that includes ESG ratings for various firms. Of course these are numeric values, but the ESG variable is currently loaded in Stata as a string because it includes observations with NA (meaning not available). I want to destring this variable, but when I try this it states that the variable includes nonnumeric values, which makes sense as next to numbers it also includes the NAs in the observations. However, when I try to replace these NA values as missing ("." in Stata) it says that NA is not found (see screenshots as to how my data looks and the code I'm currently using).
What can I do to identify the "NA"s in my ESG data as missing, so that I can convert it to a numeric variable? Hope someone can help me out!
Kind regards,
Danielle Berg

Currently I'm working on a dataset that includes ESG ratings for various firms. Of course these are numeric values, but the ESG variable is currently loaded in Stata as a string because it includes observations with NA (meaning not available). I want to destring this variable, but when I try this it states that the variable includes nonnumeric values, which makes sense as next to numbers it also includes the NAs in the observations. However, when I try to replace these NA values as missing ("." in Stata) it says that NA is not found (see screenshots as to how my data looks and the code I'm currently using).
What can I do to identify the "NA"s in my ESG data as missing, so that I can convert it to a numeric variable? Hope someone can help me out!
Kind regards,
Danielle Berg
Comment