0

Consider a large panel consisting of bilateral trade data and policy dummy (levels 0 and 1, reference level 0).

head(data)
home    partner year gdphome      gdppartner  exports policy
Austria Albania 1988 133018182771 2126000000  8833653      0
Austria Albania 1989 132785154342 2335124988 10116497      0
Austria Albania 1990 166062376740 2101624963 12125119      0
Austria Albania 1991 173375508073 1139166646  8548989      0
Austria Albania 1992 194608183696  709452584  4949408      1
Austria Albania 1993 189921096652 1228071038  6107622      1

I am trying to estimate the effect of the policy dummy on exports, using dummies for the time periods and dropping the constant:

> reg <-lm(log(exports)~0+log(gdphome)+log(gdppartner)+policy
      +factor(year), data=fulldata)

R drops the first time dummy (1988) but includes estimates of both levels of the policy dummy:

> coefs <- coef(reg)[1:5]
> coefs
log(gdphome)              log(gdppartner)    policy0 
     1.216703971          1.097967926        -31.447622433 
   policy1               factor(year)1989 
   -30.251306284         -0.009447245 

But what I want is only one estimate for the policy dummy and all the estimates for the time dummies. It seems that R includes all levels of the model's first dummy when you drop the constant. How do I tell R to use the second dummy?

I could change the order in the model, but I don't want to have to skip all the coefficients on the time dummies in the output in oder to get my estimate on the policy variable. Another way would be to include a constant, but then the meaning of the estimates of the time dummies change.

Fusscreme
  • 152
  • 9
  • Quick thought: What is the result of `levels(data$policy)`? – Jason Morgan Nov 30 '16 at 13:40
  • Not including an intercept is usually not something you should do. I suggest you think some more about the contrasts you are interested in. – Roland Nov 30 '16 at 13:41
  • @Jason Morgan: `> levels(data$policy) [1] "0" "1" ` – Fusscreme Nov 30 '16 at 13:43
  • @Roland: I do not include the constant to compare the results of the dummy-regression with a fixed effects regression, so no constant is on purpose. – Fusscreme Nov 30 '16 at 13:46
  • I understand that and challenge your "on purpose". Include the intercept. – Roland Nov 30 '16 at 13:48
  • 2
    @Fusscreme Coercing `policy` to a numeric should solve your issue. – Jason Morgan Nov 30 '16 at 13:49
  • @Roland: I actually did that and thought the estimates on the time dummies had changed. Apparently I had a mistake in my script. I realised when I estimated it again now, as you suggested. Stupid, thank you. – Fusscreme Nov 30 '16 at 13:56

0 Answers0