Announcement

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

  • Filter Regression for years

    Hello all,

    for my Master's thesis, I am conducting a regression analysis with Stata.
    My dependent variable is "sales_growth" and my independent variable is "patriotism". I am controlling for different variables like Number of Shareholder, Age, R&D etc.

    Now the situation is that I have data from 2010-2020, but I want to limit everything to 2010-2016 without having to delete the data from 2017-2020.
    What would the command be? xtreg............?

    I am a complete amateur as far as Stata is concerned and would be very grateful for an answer!

    Best regards
    Julius


  • #2
    Code:
    help if
    Code:
    xtreg y x1...xn if year<=2016, fe cluster(companyid)

    Comment


    • #3
      Do I need
      fe cluster(companyid) ? I want to check the growth of all S&P500 firms

      Comment


      • #4
        So you have panel data right? You're probably going to want to resort to two way fixed effects, so in #2 before the comma you may want to add i.time, and yes as Andrew suggested you do need fe cluster(companyid) to perform fixed effects estimation and get unbiased estimates of standard errors. Unless you want to cluster at a higher level.

        Comment


        • #5
          so what would the command be? Befehl war:
          xtreg sales_growth Patriotism sum_rvalue_20_fsup nemp rnd nshareholders sf NationalityMix age if year<=2016 ?

          Comment


          • #6
            xtreg sales_growth Patriotism sum_rvalue_20_fsup nemp rnd nshareholders sf NationalityMix age i.time if year<2017, fe cluster([cluster_var])

            If any of your regressors is time-invariant, it will be dropped. Does patriotism vary with time?

            Also you may want to model age as a quadratic, otherwise it might drop as well due to collinearity.

            xtreg sales_growth Patriotism sum_rvalue_20_fsup nemp rnd nshareholders sf NationalityMix age age_squared i.time if year<2017, fe cluster([cluster_var])

            Comment


            • #7
              Yes, Patriotism varies with time.
              Essentially, I just want to observe the period from 2010-2016. Nothing more. And instead of deleting all my data from 17-20. i'm looking for a command that just tests the period 10-16

              Comment


              • #8
                Also, please excuse my stupidity, I am a complete amateur when it comes to statistics.

                Comment


                • #9
                  No worries, everyone starts somewhere, no one was blessed with the knowledge of statistics at birth.

                  Try running the command in #6

                  Comment


                  • #10
                    what does that mean?

                    Comment


                    • #11
                      That means I recommend that you open Stata and paste this into the command box with your data loaded (replace clustervar with whatever variable you want to use for clustering):

                      Code:
                      xtreg sales_growth Patriotism sum_rvalue_20_fsup nemp rnd nshareholders sf NationalityMix age age_squared i.time if year<2017, fe cluster([cluster_var])

                      Comment

                      Working...
                      X