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
error using r2.factor margins contrast operator ?dear statalisters: i have attempted to use margins with contrast operators to compare all levels of …
The Recentered Influence Function (RIF) Decomposition of Concentration IndexHello guys! I am currently working with decomposition of concentration index by employing a Recente…
graph bar with multiple yvars with different scalesI have prepared a bar graph with the following data and code. There are two yvars with different sca…
"prodest" stata command to estimate TFPDear Stata Users, I want to use "prodest" command to estimate TFP. Can you, please adress the follo…
Quantile Regression [Demographic Health Survey Dataset]; handling survey design in analysisDear Stata pros and seniors, I am using Quantile regression - along with Oaxaca-Decomposition metho…
Subscribe to:
Post Comments (Atom)
0 Response to obtaining the first three digits
Post a Comment