Hi everyone,
For company data analysis for my thesis, I wanted to create industry dummy variables based on the company's SIC Code 2's. Yesterday I successfully managed to do that by writing this code (and similar ones with different industry names):
generate Ind_Manu=.
replace Ind_Manu=1 if inrange(Sic_code_2,2000,3999)
replace Ind_Manu=0 if Sic_code_2>3999
replace Ind_Manu=0 if Sic_code_2<2000
As a result I got a beautiful dummy variable that indicated a 1 if the company's SIC Code 2 was between 2000-3999, and a value of 0 if not.
Today I tried patching the missing SIC Code 2 values through an alternative database. I basically copied the SIC-Code from the database and inserted it into my dataset at the place of the missing value of my Sic_code_2 variable.
The value was still black, so I assumed it would still be recognized as a numerical value.
However, now I wanted to update the Dummy variable with the new Sic Code 2 data, by running the following line again:
replace Ind_Manu=1 if inrange(Sic_code_2,2000,3999)
Yesterday this line worked perfectly fine, but somehow now I get the error: "no variables defined"
I did not change the name of the variable, so I think it has something to do with the fact that I manually entered data into the Sic Code 2 variable.
Does anyone know how to resolve this issue?
Thanks in advance!
Ruben
Related Posts with Variable not recognized after modification
[Epidemiologic study] Creating a parametre based on a set a criteriaHi! in short: - What is the best way to look at prevalence in a dataset utilizing a questionaire an…
Goodness-of-fit measure, mixed-effects GLM, meglmDear all, I have a little question with respect to the output of my regression below. I ran a mixed…
Combining variables in wide format into one variable in a long datasetHi. I'd very much appreciate help with the following: I have data in long form which comprises a dru…
Testing for Equality of Coefficients with Dynamic Panel DataHello! I have conducted a systems-GMM analysis aiming to determine whether a relationship exists be…
State level panel data, federal level variableI am studying the influence of wind energy on residential electricity price. Panel data set 2000-201…
Subscribe to:
Post Comments (Atom)
0 Response to Variable not recognized after modification
Post a Comment