diff --git a/R/broom.R b/R/broom.R index bd02a99..bfe5df8 100644 --- a/R/broom.R +++ b/R/broom.R @@ -1,8 +1,8 @@ #' Augment method for fepoisson (Broom) #' #' @param x A fitted model object. -#' @param newdata Optional argument to use data different from the data used to fit -#' the model. +#' @param newdata Optional argument to use data different from the data used to +#' fit the model. #' @param ... Additional arguments passed to the method. #' #' @return A tibble with the input data and additional columns for the fitted @@ -11,18 +11,16 @@ #' @rdname broom #' #' @examples -#' if (require("broom")) { -#' set.seed(123) -#' trade_2006 <- trade_panel[trade_panel$year == 2006, ] -#' trade_2006 <- trade_2006[sample(nrow(trade_2006), 1000), ] -#' -#' mod <- fepoisson( -#' trade ~ log_dist + lang + cntg + clny | exp_year + imp_year, -#' trade_2006 -#' ) -#' -#' broom::augment(mod) -#' } +#' set.seed(123) +#' trade_2006 <- trade_panel[trade_panel$year == 2006, ] +#' trade_2006 <- trade_2006[sample(nrow(trade_2006), 1000), ] +#' +#' mod <- fepoisson( +#' trade ~ log_dist + lang + cntg + clny | exp_year + imp_year, +#' trade_2006 +#' ) +#' +#' broom::augment(mod) #' Glance method for fepoisson (Broom) #' @@ -35,23 +33,22 @@ #' @rdname broom #' #' @examples -#' if (require("broom")) { -#' set.seed(123) -#' trade_2006 <- trade_panel[trade_panel$year == 2006, ] -#' trade_2006 <- trade_2006[sample(nrow(trade_2006), 1000), ] -#' -#' mod <- fepoisson( -#' trade ~ log_dist + lang + cntg + clny | exp_year + imp_year, -#' trade_2006 -#' ) -#' -#' broom::glance(mod) -#' } +#' set.seed(123) +#' trade_2006 <- trade_panel[trade_panel$year == 2006, ] +#' trade_2006 <- trade_2006[sample(nrow(trade_2006), 1000), ] +#' +#' mod <- fepoisson( +#' trade ~ log_dist + lang + cntg + clny | exp_year + imp_year, +#' trade_2006 +#' ) +#' +#' broom::glance(mod) #' Tidy method for fepoisson (Broom) #' #' @param x A fitted model object. -#' @param conf.int Logical indicating whether to include the confidence interval. +#' @param conf.int Logical indicating whether to include the confidence +#' interval. #' @param conf.level The confidence level for the confidence interval. #' @param ... Additional arguments passed to the method. #' @@ -62,15 +59,13 @@ #' @rdname broom #' #' @examples -#' if (require("broom")) { -#' set.seed(123) -#' trade_2006 <- trade_panel[trade_panel$year == 2006, ] -#' trade_2006 <- trade_2006[sample(nrow(trade_2006), 1000), ] -#' -#' mod <- fepoisson( -#' trade ~ log_dist + lang + cntg + clny | exp_year + imp_year, -#' trade_2006 -#' ) -#' -#' broom::tidy(mod) -#' } +#' set.seed(123) +#' trade_2006 <- trade_panel[trade_panel$year == 2006, ] +#' trade_2006 <- trade_2006[sample(nrow(trade_2006), 1000), ] +#' +#' mod <- fepoisson( +#' trade ~ log_dist + lang + cntg + clny | exp_year + imp_year, +#' trade_2006 +#' ) +#' +#' broom::tidy(mod) diff --git a/R/generics_print.R b/R/generics_print.R index a5b7d1a..d76a66a 100644 --- a/R/generics_print.R +++ b/R/generics_print.R @@ -104,7 +104,7 @@ summary_estimates_print_header_ <- function(coef_width, max_widths) { function(name, width) { sprintf("| %-*s", width, name) }, - name = c("Estimate", "Std. Error", "t value", "Pr(>|t|)"), + name = c("Estimate", "Std. Error", "z value", "Pr(>|z|)"), width = max_widths + 1L ) diff --git a/R/generics_vcov.R b/R/generics_vcov.R index 6b306c2..6422e1f 100644 --- a/R/generics_vcov.R +++ b/R/generics_vcov.R @@ -89,7 +89,7 @@ vcov.feglm <- function( } else { V <- vcov_feglm_clustered_sandwich_covariance_( object, type, H, G, - cl_vars, sp_vars, k, p + cl_vars, k, p ) } } @@ -121,7 +121,7 @@ vcov_feglm_outer_covariance_ <- function(G, p) { vcov_feglm_clustered_sandwich_covariance_ <- function( object, type, H, G, - cl_vars, sp_vars, k, p) { + cl_vars, k, p) { # Check if the hessian is invertible and compute its inverse V <- try(solve(H), silent = TRUE) if (inherits(V, "try-error")) { diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 6e90996..274cc03 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -3,5 +3,5 @@ pkgdown: 2.0.7 pkgdown_sha: ~ articles: intro: intro.html -last_built: 2024-08-28T20:13Z +last_built: 2024-09-07T21:44Z diff --git a/docs/reference/apes.html b/docs/reference/apes.html index 76fbb1e..989452c 100644 --- a/docs/reference/apes.html +++ b/docs/reference/apes.html @@ -188,7 +188,7 @@

Examples

mod_bc <- bias_corr(mod) summary(mod_bc) #> Formula: trade ~ lang | year -#> <environment: 0x6341adaedc50> +#> <environment: 0x63b7e08ca458> #> #> Family: Binomial #> diff --git a/docs/reference/bias_corr.html b/docs/reference/bias_corr.html index f24ec70..982b24c 100644 --- a/docs/reference/bias_corr.html +++ b/docs/reference/bias_corr.html @@ -150,7 +150,7 @@

Examples

mod_bc <- bias_corr(mod) summary(mod_bc) #> Formula: trade ~ lang | year -#> <environment: 0x6341ad66ad78> +#> <environment: 0x63b7deab1d68> #> #> Family: Binomial #> diff --git a/docs/reference/feglm.html b/docs/reference/feglm.html index 9f4b406..a432dbe 100644 --- a/docs/reference/feglm.html +++ b/docs/reference/feglm.html @@ -218,7 +218,7 @@

Examples

summary(mod) #> Formula: trade ~ log_dist + lang + cntg + clny | exp_year + imp_year -#> <environment: 0x6341adc58f58> +#> <environment: 0x63b7e3378670> #> #> Family: Poisson #> @@ -248,7 +248,7 @@

Examples

summary(mod, type = "clustered") #> Formula: trade ~ log_dist + lang + cntg + clny | exp_year + imp_year | #> pair -#> <environment: 0x6341adc58f58> +#> <environment: 0x63b7e3378670> #> #> Family: Poisson #> diff --git a/docs/reference/felm.html b/docs/reference/felm.html index 32863ef..52424a7 100644 --- a/docs/reference/felm.html +++ b/docs/reference/felm.html @@ -162,7 +162,7 @@

Examples

summary(mod) #> Formula: log(trade) ~ log_dist + lang + cntg + clny | exp_year + imp_year -#> <environment: 0x6341adec85f0> +#> <environment: 0x63b7e27141a0> #> #> Estimates: #> diff --git a/docs/reference/fenegbin.html b/docs/reference/fenegbin.html index 1cf322c..db9d68b 100644 --- a/docs/reference/fenegbin.html +++ b/docs/reference/fenegbin.html @@ -207,7 +207,7 @@

Examples

summary(mod) #> Formula: trade ~ log_dist + lang + cntg + clny | exp_year + imp_year -#> <environment: 0x6341accad2b8> +#> <environment: 0x63b7e37ae830> #> #> Family: Negative Binomial(1.6626) #> diff --git a/docs/reference/fepoisson.html b/docs/reference/fepoisson.html index b1ac946..23ebc46 100644 --- a/docs/reference/fepoisson.html +++ b/docs/reference/fepoisson.html @@ -136,7 +136,7 @@

Examples

summary(mod) #> Formula: trade ~ log_dist + lang + cntg + clny | exp_year + imp_year -#> <environment: 0x6341ac9fa7a0> +#> <environment: 0x63b7e3403a70> #> #> Family: Poisson #>