Hello. I am working on a database that has a variable called 'sector' (string) and another one called 'code_sector' (long). Using the codebook command, I check for the unique values in each variable, and I get that there are 52 unique values in sector and 30 unique values in code_sector.
So I think there are some misspellings in the sector variables. Next, I use bysort code_sector: replace sector = sector[1] to correct the misspellings by only keeping the first name of the sectors with the same code. So far so good. But, when I use codebook again, it says that there now are just 29 unique values in the variable sector! How is that possible? One thing is that when running codebook on sector, it says ' warning: variable has embedded blanks' (it is true, the names of the sectors have spaces, but I guess it should not cause problems with this).
Thanks in advance
Related Posts with Problem using codebook
Probit RegressionHi, I have a question according to a probit regression. The variable Format is 1 if a company switch…
Synthetic control method: how to select V matrixDear all, I am learning Synthetic Control method, Stata has command Code: synth . When I read th…
Results of Diff-in-Diff and MESRDear All, I have two datasets. The first is a cross-sectional dataset for the 2017/2018 cropping sea…
New iscogen package available from SSCA new package called iscogen is now available from SSC. To install the package, type Code: . ssc i…
Time Series Panel DataThis is my first post on here, my apologies for any errors. My data is organized by State and Year.…
Subscribe to:
Post Comments (Atom)
0 Response to Problem using codebook
Post a Comment