I run three different estimations of panel linear models (fixed effects model with two fixed effect (id and year)).
fixed_YIELD_mean_to_treat.100 <- plm(YIELD_mean_total ~ treated.100 + Nightlight_sum + Population_sum + temp_mean, data= Results, index = c("id", "year"), model = "within")
fixed_YIELD_mean_fruits_treat.100<- plm(YIELD_mean_Fruit ~ treated.100 + Nightlight_sum + Population_sum + temp_mean, data= Results, index = c("id", "year"), model = "within")
fixed_YIELD_mean_grain_treat.100<- plm(YIELD_mean_Cereal ~ treated.100 + Nightlight_sum + Population_sum + temp_mean, data= Results, index = c("id", "year"), model = "within")
Now I try to create a stargazer output containing all three of the models:
stargazer( fixed_YIELD_mean_to_treat.100, fixed_YIELD_mean_fruits_treat.100, fixed_YIELD_mean_grain_treat.100,
type = "html",
align = TRUE,
omit = c("year", "id"),
omit.labels = c("year FE", "id FE"),
add.lines= list(c("ID Fixed effects", "Yes", "Yes", "Yes"),
c("Time Fixed effects", "Yes", "Yes", "Yes")),
out = ".test1.html" )
But than I get the error:
Error in if (is.na(s)) { : the condition has length > 1
If I only include 2 models it always works. How can I plot three models in one stargazer output?