Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • add a command and all generated variables and data lost.

    rename __merge __merge1 /* rename previous merge commands in order to merge tax+financial data with hotel groups data*/
    variable __merge not found

  • #2
    Unless you change it or specify otherwise, the variable created by the -merge- command is called _merge (just 1 underscore), not __merge.

    Comment


    • #3
      Thank you Mr Schechter in advance. Ialso need to fond out how to sum the var income by sorting the var business activity. How to do this?

      Comment


      • #4
        Ialso need to fond out how to sum the var income by sorting the var business activity.
        I'm not sure what you mean. Do you mean that business activity is represented by some categorical variable, and you would like to get the sum of the variable income for each of those categories? If so:

        Code:
        by business_activity, sort: egen total_income = total(income)
        Evidently replace business_activity and income by the actual names of those variables in your data set.

        Note: As no example data was supplied, this code is untested. Use at your own risk.

        In the future, when asking for help with code, always provide example data. It is also usually a good idea to show an example of what you would like the final results from your example to be--showing is often clearer than explaining in words. When showing data examples, please use the -dataex- command to do so. If you are running version 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

        Comment


        • #5
          Ok I just need to add all annual firms income by business activity, aiming to show which activities manage to produce the largest income in descending order. I think the above command is right

          Comment

          Working...
          X