Fixed Effects Quantile Regression (rqpd) with more than on type of fixed effects possible?

794 views Asked by At

I try to estimate the effect of GDP (in cubic terms) on CO2 emissions. To estimatethe effect across the distribution of CO2 emissions I want to perform a quantile regression. To decrease omitted variable bias, I want to include country fixed effects as well as decade fixed effects. I use the rqpd package provided by Koenker and Bach, especially the Penalized Fixed Effects (PFE) method.

The data consist of 3247 observation. The code is as follows:

    library(rqpd)
    y = df3_avg_10$CO2
    x1 = df3_avg_10$GDP
    x2 = df3_avg_10$GDP2
    x3 = df3_avg_10$GDP3
    s = cbind(df3_avg_10$Country, df3_avg_10$Decade)

    Quantile_avg <- rqpd(y ~ x1+x2+x3 | s, data = df3_avg_10, panel(taus=c(0.1, 0.25, 0.5, 0.75, 0.9), tauw=rep(1/5, 5)), method = "pfe", na.omit)

This yields the error message: Error in `[[<-.data.frame`(`*tmp*`, i, value = c(18L, 18L, 18L, 18L, 18L, : replacement has 6494 rows, data has 3247

If I only include Country fixed effects, the code works. Therefore, my question: Is it possible to include more than one type of fixed effects in rqpd? Or is there any other option to estimate fixed effects in quantile regression? I checked the 'lqmm' and 'quantreg' packages but couldn't find anything related. thank you very much in advance for any advice!

0

There are 0 answers