The code below runs the time series regression "excessr ~ mkt_rf" with biglm, because the function lm does not work with my real dataset.
Now I would like to switch from biglm to plm to account for fixed effects. Unfortunately plm doesn't work.
Does anyone know what I could change that plm work?
library(biglm)
library(plm)
library(data.table)
union_with_factors = data.table(
t = c(1,2,3,4,5,1,2,3,4,5,1,2,3,4,5),
excessr = c(10,23,13,53,43,76,34,12,45,13,42,31,4,53,64),
FundId = c("x","x","x","x","x","y","y","y","y","y","z","z","z","z","z"),
mkt_rf = c(1,1,2,1,3,1,1,2,1,3,1,1,2,1,3)
)
sp <- split(union_with_factors, union_with_factors$FundId)
beta <- sapply(sp, function(tmp){
fit <- plm(excessr ~ mkt_rf, data = tmp)
coef(fit)
})