diff --git a/R/AddSuptBand.R b/R/AddSuptBand.R index 31f8c7e..945ec1d 100644 --- a/R/AddSuptBand.R +++ b/R/AddSuptBand.R @@ -80,13 +80,11 @@ AddSuptBand <- function(model_estimates, num_sim = 1000, conf_level = .95, event } df_estimates_tidy <- if(fixest){ - coef_table <- model_estimates |> - fixest::coeftable() |> - as.data.frame() + coef_table <- as.data.frame(fixest::coeftable(model_estimates)) coef_table$term <- rownames(coef_table) - coef_table |> - dplyr::rename(estimate = Estimate, std.error = `Std. Error`) |> - dplyr::select(term, estimate, std.error) + names(coef_table)[names(coef_table) == "Estimate"] <- "estimate" + names(coef_table)[names(coef_table) == "Std. Error"] <- "std.error" + coef_table <- coef_table[, c("term", "estimate", "std.error")] } else {estimatr::tidy(model_estimates)} df_estimates_tidy["suptband_lower"] <- df_estimates_tidy$estimate - (critical_value * df_estimates_tidy$std.error) diff --git a/R/EventStudyPlot.R b/R/EventStudyPlot.R index c2b5c9f..3aa8584 100644 --- a/R/EventStudyPlot.R +++ b/R/EventStudyPlot.R @@ -127,13 +127,12 @@ EventStudyPlot <- function(estimates, model_estimates <- estimates$output is_fixest <- class(model_estimates) == "fixest" model_estimates_tidy <- if(is_fixest) { - coef_table <- model_estimates |> - fixest::coeftable() |> - as.data.frame() + coef_table <- as.data.frame(fixest::coeftable(model_estimates)) coef_table$term <- rownames(coef_table) - coef_table |> - dplyr::rename(estimate = Estimate, std.error = `Std. Error`) |> - dplyr::select(term, estimate, std.error) + names(coef_table)[names(coef_table) == "Estimate"] <- "estimate" + names(coef_table)[names(coef_table) == "Std. Error"] <- "std.error" + coef_table <- coef_table[, c("term", "estimate", "std.error")] + coef_table } else {estimatr::tidy(model_estimates)} static_model <- length(coef(model_estimates)) == 1