I am conducting a cross-sectional study of UK FTSE 100 firms. I want to group companies by industry into less than 20 industry groups. I initially used the following code which created individual groups for individual values of the industry codes (variable 'industry').
sort industry by industry: gen newid = 1 if _n==1 replace newid = sum(newid) replace newid = . if missing(industry) However, under the 2007 SIC codes, there are many that can be grouped into larger subsets and I desire to do this for meaningful analysis. I need suggestions for generating a new industry variable where I can decide how many SIC codes can fall under one category. For example, codes 30000 to 39999 = 3, 4000 to 47999 = 4 etc.
Related Posts with Grouping Data
Format stata summary output table with multiple variables Code: * Example generated by -dataex-. To install: ssc install dataex clear input str6 Gender floa…
Questions about two-wayHi I need to customize my graph that is plotted by twoway scatter as follows: 1-drawing a diagonal l…
How to count the individual digits in a string numberHi, I have survey data. Both the variables a7 and a8 are survey variables having multiple options c…
A problem with iteration log likelihood not concave in xtpmg commandHi everyone, When I run the PMG model by xtpmg command, I have a problem the iteration log likelihoo…
Difference-in-differences: regress or teffects?Dear Statalist users, I have been working on trying to find whether there has been a positive impact…
Subscribe to:
Post Comments (Atom)
0 Response to Grouping Data
Post a Comment