Announcement

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

  • Fixed effects panel data

    Good evening. I want to apply fixed effects in my panel data. I have data for companies for a period of several years, and variables such as sales, Etr ratio, when they went public, etc. The variable of interest will be a dummy=0 before IPO and 1 when firm goes public and the outcome is the Etr index. I want to ask what is the code to make the panel data, to create the variable of interest I mentioned and run the fixed effects model. Please help, if you can tell me the do file (commads)so to run the commands in stata

  • #2
    Johan:
    as per FAQ, this is not the way this forum works.
    That said, see -xtreg,fe-, -xtreg- entry, Stata .pdf manual.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Is the data panel, or do you want to make it panel?

      Comment


      • #4
        Originally posted by George Ford View Post
        Is the data panel, or do you want to make it panel?
        the data is a panel. I did it with xtset. I don't know how to create the variable of interest I mentioned. I have a variable called listed and it is binary. 1 if the company is listed on the stock exchange and zero if it is not. I have found the commands that I will use them but I don't know if they are correct.I thought of the commands below. To
        create variable of interest I mentioned above
        replace listed=0 if missing (listed)
        bysort taxid:drop if listed [_n]==listed [_n-1] & listed==0
        xtreg Etr sales gross profit assets,fe
        What do you say;

        Comment


        • #5
          1. if listed is binary, then why are you modifying it. Or, is it 1 and missing? If so, first line is fine.
          2. not sure why you are dropping things.

          xtset id year
          xtreg Etr listed sales gross profit assets, fe vce(cluster id)

          I suspect a selection bias problem, however. Becoming listed is not random or exogenous.

          Comment


          • #6
            Originally posted by George Ford View Post
            1. if listed is binary, then why are you modifying it. Or, is it 1 and missing? If so, first line is fine.
            2. not sure why you are dropping things.

            xtset id year
            xtreg Etr listed sales gross profit assets, fe vce(cluster id)

            I suspect a selection bias problem, however. Becoming listed is not random or exogenous.
            Good morning and thank you very much for the answer. I want to keep only the listed companies, i.e. the companies that all these years that I have the data have listed =0 should be removed from the sample.

            Comment


            • #7
              Ok. I thought you wanted to quantify effects of being listed or not.

              Comment


              • #8
                Originally posted by George Ford View Post
                Ok. I thought you wanted to quantify effects of being listed or not.
                Can you tell me about that,if it is ok
                by sort company_id: egen ever_listed = max(listed)


                keep if ever_listed == 1

                drop ever_listed

                To create the interesting variable I mentioned to you, what do you think;

                Comment

                Working...
                X