Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 1, 2024
1 parent 25e325e commit 763cd25
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 29 deletions.
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,14 @@ S3method(model_performance,censReg)
S3method(model_performance,clm)
S3method(model_performance,clm2)
S3method(model_performance,coxph)
S3method(model_performance,coxph_weightit)
S3method(model_performance,default)
S3method(model_performance,felm)
S3method(model_performance,fixest)
S3method(model_performance,fixest_multi)
S3method(model_performance,flexsurvreg)
S3method(model_performance,glm)
S3method(model_performance,glm_weightit)
S3method(model_performance,glmmTMB)
S3method(model_performance,glmmadmb)
S3method(model_performance,glmx)
Expand All @@ -197,9 +199,11 @@ S3method(model_performance,mixor)
S3method(model_performance,mlogit)
S3method(model_performance,model_fit)
S3method(model_performance,multinom)
S3method(model_performance,multinom_weightit)
S3method(model_performance,negbinirr)
S3method(model_performance,negbinmfx)
S3method(model_performance,nestedLogit)
S3method(model_performance,ordinal_weightit)
S3method(model_performance,plm)
S3method(model_performance,poissonirr)
S3method(model_performance,poissonmfx)
Expand Down
20 changes: 16 additions & 4 deletions R/model_performance.lm.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#' Compute indices of model performance for regression models.
#'
#' @param model A model.
#' @param metrics Can be `"all"`, `"common"` or a character vector of
#' metrics to be computed (one or more of `"AIC"`, `"AICc"`, `"BIC"`, `"R2"`,
#' `"R2_adj"`, `"RMSE"`, `"SIGMA"`, `"LOGLOSS"`, `"PCP"`, `"SCORE"`).
#' `"common"` will compute AIC, BIC, R2 and RMSE.
#' @param metrics Can be `"all"`, `"common"` or a character vector of metrics to
#' be computed (one or more of `"AIC"`, `"AICc"`, `"BIC"`, `"R2"`, `"R2_adj"`,
#' `"RMSE"`, `"SIGMA"`, `"LOGLOSS"`, `"PCP"`, `"SCORE"`). `"common"` will
#' compute AIC, BIC, R2 and RMSE.
#' @param verbose Toggle off warnings.
#' @param ... Arguments passed to or from other methods.
#'
Expand Down Expand Up @@ -209,6 +209,18 @@ model_performance.lm_robust <- model_performance.lm
#' @export
model_performance.multinom <- model_performance.lm

#' @export
model_performance.multinom_weightit <- model_performance.lm

#' @export
model_performance.ordinal_weightit <- model_performance.lm

#' @export
model_performance.coxph_weightit <- model_performance.lm

#' @export
model_performance.glm_weightit <- model_performance.lm

#' @export
model_performance.plm <- model_performance.lm

Expand Down
20 changes: 10 additions & 10 deletions R/r2_coxsnell.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
#' @param ... Currently not used.
#'
#' @details
#' This index was proposed by *Cox and Snell (1989, pp. 208-9)* and,
#' apparently independently, by *Magee (1990)*; but had been suggested
#' earlier for binary response models by *Maddala (1983)*. However, this
#' index achieves a maximum of less than 1 for discrete models (i.e. models
#' whose likelihood is a product of probabilities) which have a maximum of 1,
#' instead of densities, which can become infinite *(Nagelkerke, 1991)*.
#' This index was proposed by *Cox and Snell (1989, pp. 208-9)* and, apparently
#' independently, by *Magee (1990)*; but had been suggested earlier for binary
#' response models by *Maddala (1983)*. However, this index achieves a maximum
#' of less than 1 for discrete models (i.e. models whose likelihood is a product
#' of probabilities) which have a maximum of 1, instead of densities, which can
#' become infinite *(Nagelkerke, 1991)*.
#'
#' @return A named vector with the R2 value.
#'
Expand All @@ -24,12 +24,12 @@
#' @references
#' - Cox, D. R., Snell, E. J. (1989). Analysis of binary data (Vol. 32).
#' Monographs on Statistics and Applied Probability.
#' - Magee, L. (1990). R 2 measures based on Wald and likelihood ratio
#' joint significance tests. The American Statistician, 44(3), 250-253.
#' - Magee, L. (1990). R 2 measures based on Wald and likelihood ratio joint
#' significance tests. The American Statistician, 44(3), 250-253.
#' - Maddala, G. S. (1986). Limited-dependent and qualitative variables in
#' econometrics (No. 3). Cambridge university press.
#' - Nagelkerke, N. J. (1991). A note on a general definition of the
#' coefficient of determination. Biometrika, 78(3), 691-692.
#' - Nagelkerke, N. J. (1991). A note on a general definition of the coefficient
#' of determination. Biometrika, 78(3), 691-692.
#'
#' @export
r2_coxsnell <- function(model, ...) {
Expand Down
2 changes: 1 addition & 1 deletion man/check_dag.Rd

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

8 changes: 4 additions & 4 deletions man/model_performance.lm.Rd

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

20 changes: 10 additions & 10 deletions man/r2_coxsnell.Rd

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

0 comments on commit 763cd25

Please sign in to comment.