I have naics codes that have six digits, and I want to get the first three digits in each of them and form a new variable named three_digits
I tried using the "gen threedigit=int(Naics_1/1000)" (this gave me a list of zeros in the newly generated variable)
Looking at answers to similar posts, I used "gen three_digit=substr(naics, 1,2,3)" and it was an Invalid Syntax
Thank you.
Related Posts with obtaining the first three digits
Collinearity between two country variables, one nominal (country name) and the other metric (globalisation level)Hi I experience heavy (perfect) multicollinearity between a control variable and my main independen…
Pesaran CSD Test Keeps Giving Errors!Hi everyone, I use Stata13 and I have a panel data of 38 countries across 6 years. I tried performin…
Pesanran CSD Test Keeps Giving Errors!Hi everyone, I use Stata13 and I have a panel data of 38 countries across 6 years. I tried performin…
New verson of cprdenttype on SSCThanks as always to Kit Baum, a new version of the cprdenttype package is now available for download…
multishell module can't find my stata.exeHello Statalist Forum, I am using Stata 15 on Windows 10. Currently I try to rebuild the example i…
Subscribe to:
Post Comments (Atom)
0 Response to obtaining the first three digits
Post a Comment