According to Wooldridge (2016) "When we include a full set of year dummies — that is, year dummies for all years but the first — we cannot estimate the effect of any variable whose change across time is constant". He gives an example of work experience (in the case that each person works every year), which increases by one each year. However, people can have very different years of work experience to start with. Meaning that Person 1 can have a work experience of 1 year at the start of the data sample, and Person 2 might have a work experience of 22 years at the start of the data sample.
I recreated this type of problem with a dummy data set and the age of a country:
library(foreign)
library(dplyr)
Panel <- read.dta("http://dss.princeton.edu/training/Panel101.dta")
Panel <- Panel %>%
filter(country == "A" | country == "B")
Panel <- Panel %>%
mutate(country_age = case_when(year == 1990 & country == "A" ~ 22,
year == 1991 & country == "A" ~ 23,
year == 1992 & country == "A"~ 24,
year == 1993 & country == "A"~ 25,
year == 1994 & country == "A"~ 26,
year == 1995 & country == "A"~ 27,
year == 1996 & country == "A"~28,
year == 1997 & country == "A"~ 29,
year == 1998 & country == "A"~ 30,
year == 1999 & country == "A"~ 31))
Panel <- Panel %>%
mutate(country_age = case_when(year == 1990 & country == "B" ~ 1,
year == 1991 & country == "B" ~ 2,
year == 1992 & country == "B"~ 3,
year == 1993 & country == "B"~ 4,
year == 1994 & country == "B"~ 5,
year == 1995 & country == "B"~ 6,
year == 1996 & country == "B"~ 7,
year == 1997 & country == "B"~ 8,
year == 1998 & country == "B"~ 9,
year == 1999 & country == "B"~ 10,
TRUE ~ country_age))
lmod <- lm(y ~ x1 + country_age + factor(year) - 1, data = Panel)
summary(lmod)
To my surpise, I get a coefficient for each of the year dummies as well as the country_age variable which increases by a constant of 1 for both countries. Isn't that contradictory what is written in Wooldridge? Country_age changes constant through time and I can still get an estimate for this variable.
Only if I use the same time series for both countries like this,
library(foreign)
library(dplyr)
Panel <- read.dta("http://dss.princeton.edu/training/Panel101.dta")
Panel <- Panel %>%
filter(country == "A" | country == "B")
Panel <- Panel %>%
mutate(country_age = case_when(year == 1990 & country == "A" ~ 1,
year == 1991 & country == "A" ~ 2,
year == 1992 & country == "A"~ 3,
year == 1993 & country == "A"~ 4,
year == 1994 & country == "A"~ 5,
year == 1995 & country == "A"~ 6,
year == 1996 & country == "A"~7,
year == 1997 & country == "A"~ 8,
year == 1998 & country == "A"~ 9,
year == 1999 & country == "A"~ 10))
Panel <- Panel %>%
mutate(country_age = case_when(year == 1990 & country == "B" ~ 1,
year == 1991 & country == "B" ~ 2,
year == 1992 & country == "B"~ 3,
year == 1993 & country == "B"~ 4,
year == 1994 & country == "B"~ 5,
year == 1995 & country == "B"~ 6,
year == 1996 & country == "B"~ 7,
year == 1997 & country == "B"~ 8,
year == 1998 & country == "B"~ 9,
year == 1999 & country == "B"~ 10,
TRUE ~ country_age))
lmod <- lm(y ~ x1 + country_age + factor(year) - 1, data = Panel)
summary(lmod)
I am not getting an estimate for one of the year dummies.
Am I interpreting something wrong in the statement of Wooldridge? I don't know where I would, because I kind off recreated the exact example he gives in that regard.
Or is the statement in Wooldridge flawed (which I highly doubt) and it is only impossible to estimate variables that have the exact same time series for all entities, when using time fixed effects (e.g., macroeconomic variables).