Announcement

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

  • How can I go about adding dummy variable to my analysis using Fixed Effects?

    Hi everyone!

    I am currently trying to analyze the impact of militaryexpenditure(ME) on GDP growth in a panel data set using Fixed Effect. I have my list of countries already as a variable as "Country". I have created the countries into a group variable using egen id= group(country). this variable is called id. The other variable is Capital formation (CF). My variable Year is for the time period 1997 to 2017

    I wanted to see if the financial crises of 2001 and 2008, 2009 had any impact on military expenditure and economic growth. I'm not really sure how to go about doing that in my regression. I did gen recession= (Year==2001| Year==2008|Year==2009)

    My model is:
    lnGDP = α0+α1lnME+α2ln(CF)+ε which is using a log function.

    For my Fixed Effect model, I did Xtset id Year(this is for the years from 1997 to 2017), yearly
    I did Xtreg ln(GDP) ln(ME) lnCF , fe r

    However, I am not sure how to include the dummy variable into my regression to test for those years. Any help is appreciated!

  • #2
    much of what you write is unclear to me; however, if you want to include a dummy that is "1" if any of those years and 0 otherwise, just include "i.recession" as one of the predictors; see
    Code:
    help fvvarlist
    if you want something else, please clarify (the FAQ has lots of good advice on asking good questions - please read it)

    Comment


    • #3
      Click image for larger version

Name:	2018-09-28 21_33_08-2 - Stata_IC 15.1.png
Views:	1
Size:	27.6 KB
ID:	1463925



      So using what you said, which is xtreg lnGDP ln(militaryspending) ln(capital formation) i. recession, fe r this is what I got. I put the full name in parenthese to make it easier to understand. Is that saying that during the recession years, there was a .016% decrease in GDP?

      Comment


      • #4
        Bob:
        your dependent variable is logged, whereas i.recession is not.
        Hence, when adjusted for the remaining predictors, moving from no recession(coded 0) to recession (coded 1), reduces the dependent variable of 1.591332%, as you can see from the following lines:
        Code:
        . di (1-exp(-.0160413))*100
        1.5913324
        That said, more substantive comments should focus on your current regression model.
        1) I do not tell us whether the user-written programme -xtoverid- (-hausman- does not support non-default standard errors) led your decision to go -fe-;
        2) as per your -xtreg,fe- outcome, you seem to deal with a T>N panel dataset.
        You're probably already aware of the difference between a N>T panel dataset and I assume that you imposed cluster/robust standard errors in order to take autocorrelation into account.
        However, I would also take a look at -xtgls-.
        Kind regards,
        Carlo
        (Stata 18.0 SE)

        Comment

        Working...
        X