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
Creating and storing residuals in a loopHi all I am trying to run the following code. The purpose is to capture industry and year wise resi…
System GMM and AB test for AR(2)Hi All: I am using system GMM method to estimate my panel data (T=6). I am new to this method. I kn…
Documentation for non existent functionI was learning string functions in Stata. After obtaining help using help string functions command, …
Creating and storing residuals in a loop Code: forvalues y = 2015/2017 { // Define a for/next loop spanning years in sample …
How to declare weekly data as time series data in Stata 15Dear All I want to use time series data on a weekly basis. When I try, I get the error "repeated tim…
Subscribe to:
Post Comments (Atom)
0 Response to Problem using codebook
Post a Comment