Announcement

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

  • #16
    In #14, you said What do you mean by "a firm", whether it means "every firm" or [COLOR=#000080]"at least one firm"?

    Here I refer to at least one firm. We can stick to the explanation in #14 as that's straight forward enough. Its same as in #10 but I realised its more straight forward to understand in what I gave in #14.

    What do you mean by
    "a firm"
    , whether it means
    "every firm"
    or
    "at least one firm"?
    The phrase "
    keep only CEO
    " should also be rechecked since it is contrast with your code in #12, which tends to drop unsatisfied firms rather than unwanted CEO.

    My focus is to take away unwanted CEOs

    Comment


    • #17
      Then it seems to be clear now. You want to keep all CEOs (and their firms) if: (1) They have worked for at least 2 firms: and (2) They have worked for at least 1 firm for at least 3 years. An adjudgment with my code in #13 will give you this target.
      Code:
      * Total Number of Firms each CEO working for
      
      bys ceo (firm): egen tag1=total(firm!=firm[_n-1])
      
      * Total Number of Firms each CEO working for at least 3 year
      
      bys ceo (firm): egen tag2=total(firm!=firm[_n-1] & firm==firm[_n+2])
      
      * CEO to be kept if total firms is larger or equal 2
      * and total firms (with at least 3 years of working) is larger or equal 1
      
      keep if tag1 >1 & tag2>0

      Comment


      • #18
        We are almost there.

        So I
        want to keep all CEOs (and their firms) if: (1) They have worked for at least 2 firms for a minimum of three years each: thus after running this my set now only has CEOs and their firms with each CEO having worked at two firms for a minimum of 3 years each. Now lets call this sample A.

        Using this sample A, it is possible that after having worked for at least two firms(A and B) for a minimum of three years each, a CEO, say John, could have worked at a THIRD FIRM(C) for a year, a fourth firm(D) for 2 years and say a fifth firm(E) for 3 years. so (2) Keep only firms in sample A for which CEO, John, has worked three years and above. That will leave us with firm A,B and E for John.

        Many thanks for your patience.

        Comment


        • #19
          Well, you are traveling in a twsiting trip. We are almost there? or still here? or being lost in somewhere?

          For the description in #18, your code in #12 is a correct way, while the code in #17 would take you to other direction.

          So where is the place that you wanna go? You should clarify out the clear target for yourself and select the right road to go.

          Along with our discussion, you have got (for each CEO) some good “tools”, including: tag1 (tolal number of firms), tag2 (total number of firrms with at least 3 years) and tennure (total years for each firm). A right combination of qualifier (if) for these “tools” is the solution that you have to try and check.

          Thanks for ... thanking me, but dont worry, I do feel comfortable sharing the trip with you. You are now at the first steps to Stata, like me some years ago. Once upon a very begining time for anyone...

          Comment


          • #20
            That's great cos I'm on my way to #18..lol. Thanks a million for sharing this journey with me. I know the codes will be very useful. Thanks once again

            Comment

            Working...
            X