Announcement

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

  • Excluding one country from the sample when running the regression

    Hello,

    I would like to run my regression without taken into consideration specific country(Countries). I assign a number for each country(from 1 to 24) so I am having 24 countries. I do not know the syntax to do that I would appreciate your help.

    Best regards,
    Sally

  • #2
    Sally:
    an advice might be (in the following code, other thungs being equal, Stata will rule out -country- #1 observation(s)):
    Code:
    regress y x if country>1
    Last edited by Carlo Lazzaro; 06 Dec 2021, 10:29.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo,

      The country I want to exclude is no 4 so I wrote this code but there is an error I do not know how to include 2 ifs in the code kindly check this:

      Code:
      reg Y X i.year i.IndustryX if year>2001 & year<2019 if CountryX<4 & CountryX>4, vce (robust)
      Country X represents the number I assigned for each country

      Comment


      • #4
        Sally:
        does the following code work?
        Code:
        reg Y X i.year i.IndustryX if year>2001 & year<2019 & CountryX!=4, vce (robust)
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Hi Carlo,

          Yes it works! thank you.

          Best regards,
          Sally

          Comment

          Working...
          X