Announcement

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

  • How to interact a variable with Fixed Effect. Help!

    Hi!
    I am working on my final paper and could need som help.
    What i'm trying to do is to investigate if a tax who was implemented on 2018 second quarter had any effect on total passengers traveling. I want to include GDP for the start period 2015 first quarter and interact that variable with my quarterly fix effects. That is, if the value of GDP for a country was 1300 in the first quarter of my data, I want to interact that with each quarterly dummy - this would give me a value that will exist for each quarter. How can I do it in Stata?
    Attached Files

  • #2
    David:
    do you mean something like:
    Code:
    c.GDP##.quarter
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      David:
      do you mean something like:
      Code:
      c.GDP##.quarter
      I tried it but it did not work for me. Does that code make the GDP interact with the quartile dummy? Why does it not work for me in that case?
      I posted my do-file with my data if that could give any idea of what I'm talking about.
      Click image for larger version

Name:	bild14.png
Views:	1
Size:	23.9 KB
ID:	1492340

      Your time and help would greatly be appreciated

      David

      Comment


      • #4
        David:
        there was a typo in my previous code, that should be read as:
        Code:
        c.GDP##i.quarter
        That said, you should plug in the interaction among the predictors of the right-hand side of your regerssion equation.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Originally posted by Carlo Lazzaro View Post
          David:
          there was a typo in my previous code, that should be read as:
          Code:
          c.GDP##i.quarter
          That said, you should plug in the interaction among the predictors of the right-hand side of your regerssion equation.
          I still get " c.GDPperCapita##i.Quarter
          unrecognized command: c.GDPperCapita invalid command name
          r(199);"

          What am i doing wrong?
          Attached Files

          Comment


          • #6
            David:
            you Stata code is illegal.
            You should plug in the interaction among the predictors of the right-hand side of your regerssion equation, that is something like:
            Code:
            xtreg <depvar> i.GDPperCapita##i.quarter <otherindepvar>
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7

              Hello Carlo Lazzaro, please help me with my data panel. I want to make graphics and in my state this message appears . line IP CMI (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) (note: scheme s2color not found, using s2color) system limit exceeded - see manual (note: default scheme s2color not found, ignored) (note: _restyle could not find style indexed 7 in the current scheme for class gsize) (note: _restyle could not find style indexed 1 in the current scheme for class margin) (note: _restyle could not find style indexed 1 in the current scheme for class gsize) (note: _restyle could not find style indexed 1 in the current scheme for class margin) (note: _restyle could not find style indexed 9 in the current scheme for class compass2dir) (note: textboxstyle not found in scheme, default attributes used) (note: tickstyle not found in scheme, default attributes used) (note: gridstyle not found in scheme, default attributes used) (note: ticksetstyle not found in scheme, default attributes used) (note: ticksetstyle not found in scheme, default attributes used) (note: ticksetstyle not found in scheme, default attributes used) (note: ticksetstyle not found in scheme, default attributes used) (note: axisstyle not found in scheme, default attributes used) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: textboxstyle not found in scheme, default attributes used) (note: _restyle could not find style indexed 1 in the current scheme for class tb_orientstyle) (note: _restyle could not find style indexed 1 in the current scheme for class yesno) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: _restyle could not find style indexed 1 in the current scheme for class transformstyle) (note: _restyle could not find style indexed 1 in the current scheme for class yesno) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: _restyle could not find style indexed 1 in the current scheme for class yesno) (note: _restyle could not find style indexed 1 in the current scheme for class transformstyle) (note: _restyle could not find style indexed 9 in the current scheme for class compass2dir) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: textboxstyle axis_title not found in scheme, default attributes used) (note: textboxstyle not found in scheme, default attributes used) (note: axisstyle not found in scheme, default attributes used) (note: _restyle could not find style indexed 1 in the current scheme for class margin) (note: shadestyle not found in scheme, default attributes used) (note: linestyle foreground not found in scheme, default attributes used) (note: linestyle not found in scheme, default attributes used) (note: shadestyle foreground not found in scheme, default attributes used) (note: shadestyle not found in scheme, default attributes used) (note: linestyle foreground not found in scheme, default attributes used) (note: linestyle not found in scheme, default attributes used) (note: shadestyle foreground not found in scheme, default attributes used) (note: shadestyle not found in scheme, default attributes used) (note: _restyle could not find style indexed 2 in the current scheme for class horizontal) (note: _restyle could not find style indexed 2 in the current scheme for class vertical) (note: _restyle could not find style indexed 9 in the current scheme for class compass2dir) (note: linestyle foreground not found in scheme, default attributes used) (note: linestyle not found in scheme, default attributes used) (note: shadestyle foreground not found in scheme, default attributes used) (note: shadestyle not found in scheme, default attributes used) (note: linestyle foreground not found in scheme, default attributes used) (note: linestyle not found in scheme, default attributes used) (note: shadestyle foreground not found in scheme, default attributes used) (note: shadestyle not found in scheme, default attributes used) (note: linestyle foreground not found in scheme, default attributes used) (note: linestyle not found in scheme, default attributes used) (note: shadestyle foreground not found in scheme, default attributes used) (note: shadestyle not found in scheme, default attributes used) (note: linestyle foreground not found in scheme, default attributes used) (note: linestyle not found in scheme, default attributes used) (note: shadestyle foreground not found in scheme, default attributes used) (note: shadestyle not found in scheme, default attributes used) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: _restyle could not find style indexed 1 in the current scheme for class yesno) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: _restyle could not find style indexed 1 in the current scheme for class margin) (note: graphstyle graph not found in scheme, default attributes used) (note: graphstyle not found in scheme, default attributes used) (note: color background not found in scheme, default attributes used) (note: linestyle foreground not found in scheme, default attributes used) (note: linestyle not found in scheme, default attributes used) (note: shadestyle foreground not found in scheme, default attributes used) (note: shadestyle not found in scheme, default attributes used) (note: linestyle foreground not found in scheme, default attributes used) (note: linestyle not found in scheme, default attributes used) (note: shadestyle foreground not found in scheme, default attributes used) (note: shadestyle not found in scheme, default attributes used) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: _restyle could not find style indexed 1 in the current scheme for class yesno) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: plotregionstyle twoway not found in scheme, default attributes used) (note: plotregionstyle not found in scheme, default attributes used) (note: _restyle could not find style indexed 1 in the current scheme for class yxtype) (note: _restyle could not find style indexed 2 in the current scheme for class symbol) (note: _restyle could not find style indexed 7 in the current scheme for class symbolsize) (note: _restyle could not find style indexed 14 in the current scheme for class symbol) (note: _restyle could not find style indexed 7 in the current scheme for class symbolsize) (note: _restyle could not find style indexed 4 in the current scheme for class horizontal) (note: _restyle could not find style indexed 5 in the current scheme for class vertical_text) (note: _restyle could not find style indexed 1 in the current scheme for class connectstyle) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: _restyle could not find style indexed 1 in the current scheme for class yesno) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: _restyle could not find style indexed 2 in the current scheme for class yesno) (note: _restyle could not find style indexed 1 in the current scheme for class yesno) (note: _restyle could not find style indexed 1 in the current scheme for class xyaddviews) (note: _restyle could not find style indexed 1 in the current scheme for class ordstyle) (note: _restyle could not find style indexed 1 in the current scheme for class yxbartype_g) (note: _restyle could not find style indexed 1 in the current scheme for class yesno) (note: _restyle could not find style indexed 1 in the current scheme for class yesno) (note: _restyle could not find style indexed 1 in the current scheme for class xyaddviews) option seriesid() not allowed r(198); end of do-file r(198); ******************************* ************************************************** ************************************************** ************************************************** *****************************about the cluster command,xtreg Y X y14 y15 y16,fe vce(cluster Muni).
              what is its function and importance in the models. +++

              I'm using Stata 14
              thanks for your answer
              Last edited by Harry Mamani; 09 Apr 2019, 12:34.

              Comment


              • #8
                Originally posted by Carlo Lazzaro View Post
                David:
                you Stata code is illegal.
                You should plug in the interaction among the predictors of the right-hand side of your regerssion equation, that is something like:
                Code:
                xtreg <depvar> i.GDPperCapita##i.quarter <otherindepvar>
                It worked for me! Thanks alot!

                Comment

                Working...
                X