I have several regression models using plm
and pooling
. My data is a pooled cross sectional / time series data, with data on bond issuances. The data consists of observations of around 2000 bond issuances, with around 25 bond-descriptive variables.
I want to calculate the robust standard errors for one or all of the regression models, in order to add it in my stargazer visualization. My regressions are as follows:
#Regression
primaryreg4 <- plm(issueyield ~ issuer + exchange + yearmonth + maturity.cat + size.cat + coupontype,
data = data,
index = c("ID", "issuedate"),
model = "pooling")
All the variables are fixed effects (FE), so they are dummy variables. I want to calculate the robust standard errors of this model, and add it to stargazer. The code I have tried in order to calculate the standard errors is:
cov.r4 <- vcovHC(primaryreg4, type = "HC3")
robust_se_r4 <- sqrt(diag(cov.r4))
# or (it is the same)
robust_se_r4 <- sqrt(diag(vcovHC(primaryreg4, type = "HC3")))
I would then specify the standard errors in stargazer to be robust_se_r
. However, i get this error message:
Error: cannot allocate vector of size 15.8 Gb
Does anyone know how to solve this? I understand that it is a memory problem, but the file really should not be too big - my data is about 2000 observations of 25 variables (not too big!).