I am working with panel data using the plm
package in R and need to specify a state and year fixed effects model with linear state-specific trends. I have the following code so far:
pnl_sb <- pdata.frame(seatbelt.df, index = c("fips","year"))
twyreg <- plm(fatalityrate~sb_useage+primary*sb_useage+secondary*sb_useage+speed65+speed70+ba08+drinkage21+log(income)+age, data = pnl_sb, model = "within", effect = "twoways")
fips
is the unit variable states and year
is the time variable. I simply do not know how to implement state-specific trends. I thought that it would be assumed with 2 way fixed effects panel data that added year as a time trend. But, I am having some doubts.