I am using following code with panel data. I am able to get the year fixed effect but I am unable to get the bank fixed effect. I am getting the bank effect by using lm but not by plm.
I am sharing the sample data :
p_data <- pdata.frame(data_1, index = c("id", "time"),drop.index = TRUE)
fixed1 <- plm(y ~ x, data=p_data, model="within")
summary(fixed1)
fixed2 <- plm(y ~ x + factor(year) - 1, data=p_data, model="within")
summary(fixed2)
fixed3 <- plm(y ~ x + factor(bank) - 1, data=p_data, model="within")
summary(fixed3)
fixed4 <- plm(y ~ x + factor(year) + factor(bank) - 1, data = p_data, model="within")
summary(fixed4)