Skip to content

Commit

Permalink
document methods
Browse files Browse the repository at this point in the history
  • Loading branch information
pachadotdev committed Feb 14, 2024
1 parent 5baad79 commit 2134606
Show file tree
Hide file tree
Showing 28 changed files with 572 additions and 25 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
^README\.Rmd$
^README\.html$
^pkgdown$
^Makefile$
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ importFrom(Formula,Formula)
importFrom(MASS,negative.binomial)
importFrom(MASS,theta.ml)
importFrom(dplyr,across)
importFrom(dplyr,all_of)
importFrom(dplyr,filter)
importFrom(dplyr,group_by)
importFrom(dplyr,mutate)
Expand Down
2 changes: 1 addition & 1 deletion R/capybara-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' and Wanner (2020).
#'
#' @name capybara-package
#' @importFrom dplyr across filter group_by mutate mutate_at select
#' @importFrom dplyr across all_of filter group_by mutate mutate_at select
#' summarise ungroup vars where
#' @importFrom rlang sym :=
#' @importFrom Formula Formula
Expand Down
17 changes: 11 additions & 6 deletions R/generics_summary.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#' @title Summary method for fixed effects APEs
#' @inherit vcov.apes
#' @export
#' @noRd
summary.apes <- function(object) {
summary.apes <- function(object, ...) {
# Compute coefficent matrix
est <- object[["delta"]]
se <- sqrt(diag(object[["vcov"]]))
Expand All @@ -14,11 +15,13 @@ summary.apes <- function(object) {
structure(list(cm = cm), class = "summary.apes")
}

#' @title Summary method for fixed effects GLMs
#' @inherit vcov.feglm
#' @export
#' @noRd
summary.feglm <- function(
object,
type = c("hessian", "outer.product", "sandwich", "clustered")) {
type = c("hessian", "outer.product", "sandwich", "clustered"),
...) {
# Compute coefficients matrix
est <- object[["coefficients"]]
se <- sqrt(diag(vcov(object, type)))
Expand Down Expand Up @@ -58,11 +61,13 @@ summary.feglm <- function(
structure(res, class = "summary.feglm")
}

#' @title Summary method for fixed effects LMs
#' @inherit vcov.felm
#' @export
#' @noRd
summary.felm <- function(
object,
type = "hessian") {
type = "hessian",
...) {
# Compute coefficients matrix
est <- object[["coefficients"]]
se <- sqrt(diag(vcov(object, type)))
Expand Down
10 changes: 7 additions & 3 deletions R/generics_vcov.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
#' @description Covariance matrix for the estimator of the
#' average partial effects from objects returned by \code{\link{apes}}.
#' @param object an object of class \code{"apes"}.
#' @param ... additional arguments.
#' @return A named matrix of covariance estimates.
#' @seealso \code{\link{apes}}
#' @export
vcov.apes <- function(object) {
vcov.apes <- function(object, ...) {
object[["vcov"]]
}

Expand All @@ -20,14 +21,16 @@ vcov.apes <- function(object) {
#' estimator. \code{"sandwich"} is the sandwich estimator (sometimes also
#' referred as robust estimator), and \code{"clustered"} computes a clustered
#' covariance matrix given some cluster variables.
#' @param ... additional arguments.
#' @return A named matrix of covariance estimates.
#' @references Cameron, C., J. Gelbach, and D. Miller (2011). "Robust Inference
#' With Multiway Clustering". Journal of Business & Economic Statistics 29(2).
#' @seealso \code{\link{feglm}}
#' @export
vcov.feglm <- function(
object,
type = c("hessian", "outer.product", "sandwich", "clustered")) {
type = c("hessian", "outer.product", "sandwich", "clustered"),
...) {
# Check validity of input argument 'type'
type <- match.arg(type)

Expand Down Expand Up @@ -159,6 +162,7 @@ vcov.feglm <- function(
#' @export
vcov.felm <- function(
object,
type = c("hessian", "outer.product", "sandwich", "clustered")) {
type = c("hessian", "outer.product", "sandwich", "clustered"),
...) {
vcov.feglm(object, type)
}
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-02-08T00:11Z
last_built: 2024-02-14T19:48Z

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.

2 changes: 1 addition & 1 deletion 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.

12 changes: 12 additions & 0 deletions docs/reference/index.html

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

116 changes: 116 additions & 0 deletions docs/reference/summary.apes.html

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

Loading

0 comments on commit 2134606

Please sign in to comment.