Skip to content

Commit

Permalink
fix goodpractise messages
Browse files Browse the repository at this point in the history
  • Loading branch information
pachadotdev committed Sep 7, 2024
1 parent 7d03fb6 commit 2c5de66
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 50 deletions.
73 changes: 34 additions & 39 deletions R/broom.R
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
#'
Expand All @@ -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.
#'
Expand All @@ -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)
2 changes: 1 addition & 1 deletion R/generics_print.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
4 changes: 2 additions & 2 deletions R/generics_vcov.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
}
Expand Down Expand Up @@ -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")) {
Expand Down
2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 1 addition & 1 deletion docs/reference/apes.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/bias_corr.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/reference/feglm.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/felm.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/fenegbin.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/fepoisson.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2c5de66

Please sign in to comment.