Skip to content

Commit

Permalink
Reduce number of methods in docs (#907)
Browse files Browse the repository at this point in the history
* Reduce number of methods in docs

* fix
  • Loading branch information
strengejacke authored Oct 4, 2023
1 parent 14bddf1 commit 70cee9b
Show file tree
Hide file tree
Showing 45 changed files with 252 additions and 1,065 deletions.
6 changes: 2 additions & 4 deletions R/methods_FactoMineR.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,16 @@ model_parameters.PCA <- function(model,


# add class-attribute for printing
if ("PCA" %in% class(model)) {
if (inherits(model, "PCA")) {
attr(loadings, "type") <- "pca"
class(loadings) <- unique(c("parameters_pca", "see_parameters_pca", class(loadings)))
} else if ("FAMD" %in% class(model)) {
} else if (inherits(model, "FAMD")) {
attr(loadings, "type") <- "fa"
class(loadings) <- unique(c("parameters_efa", "see_parameters_efa", class(loadings)))
}

loadings
}


#' @rdname model_parameters.principal
#' @export
model_parameters.FAMD <- model_parameters.PCA
1 change: 0 additions & 1 deletion R/methods_PMCMRplus.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#' @rdname model_parameters.averaging
#' @export
model_parameters.PMCMR <- function(model, ...) {
insight::check_if_installed("PMCMRplus")
Expand Down
5 changes: 0 additions & 5 deletions R/methods_aov.R
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ standard_error.anova <- standard_error.aov
#' @export
p_value.anova <- p_value.aov

#' @rdname model_parameters.aov
#' @export
model_parameters.anova <- model_parameters.aov

Expand All @@ -269,7 +268,6 @@ standard_error.aovlist <- standard_error.aov
#' @export
p_value.aovlist <- p_value.aov

#' @rdname model_parameters.aov
#' @export
model_parameters.aovlist <- model_parameters.aov

Expand Down Expand Up @@ -333,15 +331,12 @@ model_parameters.afex_aov <- function(model,

# others ------

#' @rdname model_parameters.aov
#' @export
model_parameters.anova.rms <- model_parameters.aov

#' @rdname model_parameters.aov
#' @export
model_parameters.Anova.mlm <- model_parameters.aov

#' @rdname model_parameters.aov
#' @export
model_parameters.maov <- model_parameters.aov

Expand Down
1 change: 0 additions & 1 deletion R/methods_bamlss.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#' @rdname model_parameters.stanreg
#' @inheritParams insight::get_parameters
#' @export
model_parameters.bamlss <- function(model,
Expand Down
1 change: 0 additions & 1 deletion R/methods_bayesQR.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#' @rdname model_parameters.stanreg
#' @export
model_parameters.bayesQR <- function(model,
centrality = "median",
Expand Down
1 change: 0 additions & 1 deletion R/methods_bbmle.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#' @rdname model_parameters.averaging
#' @export
model_parameters.mle2 <- model_parameters.glm

Expand Down
1 change: 0 additions & 1 deletion R/methods_cplm.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ p_value.zcpglm <- function(model,

########## .bcpglm ---------------

#' @rdname model_parameters.stanreg
#' @export
model_parameters.bcplm <- model_parameters.bayesQR

Expand Down
1 change: 0 additions & 1 deletion R/methods_emmeans.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# model_parameters ----------------


#' @rdname model_parameters.averaging
#' @export
model_parameters.emmGrid <- function(model,
ci = 0.95,
Expand Down
1 change: 0 additions & 1 deletion R/methods_epi2x2.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#' @rdname model_parameters.averaging
#' @export
model_parameters.epi.2by2 <- function(model, verbose = TRUE, ...) {
# get parameter estimates
Expand Down
1 change: 0 additions & 1 deletion R/methods_fitdistr.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#' @rdname model_parameters.averaging
#' @export
model_parameters.fitdistr <- function(model,
exponentiate = FALSE,
Expand Down
1 change: 0 additions & 1 deletion R/methods_gam.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#################### .gam ------


#' @rdname model_parameters.cgam
#' @export
model_parameters.gam <- model_parameters.cgam

Expand Down
10 changes: 7 additions & 3 deletions R/methods_gamlss.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#################### .gamlss ------

#' @rdname model_parameters.cgam

#' @export
model_parameters.gamlss <- model_parameters.gam


#' @export
standard_error.gamlss <- function(model, ...) {
parms <- insight::get_parameters(model)
utils::capture.output(cs <- summary(model))
utils::capture.output({
cs <- summary(model)
})

.data_frame(
Parameter = parms$Parameter,
Expand All @@ -21,7 +23,9 @@ standard_error.gamlss <- function(model, ...) {
#' @export
p_value.gamlss <- function(model, ...) {
parms <- insight::get_parameters(model)
utils::capture.output(cs <- summary(model))
utils::capture.output({
cs <- summary(model)
})
.data_frame(
Parameter = parms$Parameter,
p = as.vector(cs[, 4]),
Expand Down
1 change: 0 additions & 1 deletion R/methods_gjrm.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#' @rdname model_parameters.averaging
#' @export
model_parameters.SemiParBIV <- function(model,
ci = 0.95,
Expand Down
1 change: 0 additions & 1 deletion R/methods_ivfixed.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ p_value.ivFixed <- function(model, method = "wald", ...) {
}


#' @rdname model_parameters.averaging
#' @export
model_parameters.ivFixed <- function(model,
ci = 0.95,
Expand Down
1 change: 0 additions & 1 deletion R/methods_ivprobit.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ standard_error.ivprobit <- function(model, ...) {
p_value.ivprobit <- p_value.default


#' @rdname model_parameters.averaging
#' @export
model_parameters.ivprobit <- model_parameters.ivFixed
1 change: 0 additions & 1 deletion R/methods_lmodel2.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# lmodel2


#' @rdname model_parameters.averaging
#' @export
model_parameters.lmodel2 <- function(model,
ci = 0.95,
Expand Down
1 change: 0 additions & 1 deletion R/methods_logistf.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# model_parameters --------------------

#' @rdname model_parameters.averaging
#' @export
model_parameters.logistf <- model_parameters.glm

Expand Down
1 change: 0 additions & 1 deletion R/methods_lrm.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# model parameters -------------


#' @rdname model_parameters.stanreg
#' @export
model_parameters.blrm <- model_parameters.bayesQR

Expand Down
5 changes: 0 additions & 5 deletions R/methods_marginaleffects.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,22 @@ model_parameters.marginaleffects <- function(model,
out
}

#' @rdname model_parameters.averaging
#' @export
model_parameters.comparisons <- model_parameters.marginaleffects


#' @rdname model_parameters.averaging
#' @export
model_parameters.marginalmeans <- model_parameters.marginaleffects


#' @rdname model_parameters.averaging
#' @export
model_parameters.hypotheses <- model_parameters.marginaleffects


#' @rdname model_parameters.averaging
#' @export
model_parameters.slopes <- model_parameters.marginaleffects


#' @rdname model_parameters.averaging
#' @export
model_parameters.predictions <- function(model,
ci = 0.95,
Expand Down
8 changes: 6 additions & 2 deletions R/methods_margins.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#' @rdname model_parameters.averaging
#' @export
model_parameters.margins <- function(model, ci = 0.95, exponentiate = FALSE, p_adjust = NULL, verbose = TRUE, ...) {
# Parameters, Estimate and CI
Expand All @@ -21,7 +20,12 @@ model_parameters.margins <- function(model, ci = 0.95, exponentiate = FALSE, p_a
# ==== Renaming

if ("Statistic" %in% names(params)) {
names(params) <- gsub("Statistic", gsub("(-|\\s)statistic", "", attr(statistic, "statistic", exact = TRUE)), names(params))
names(params) <- gsub(
"Statistic",
gsub("(-|\\s)statistic", "", attr(statistic, "statistic", exact = TRUE)),
names(params),
fixed = TRUE
)
names(params) <- gsub("chi-squared", "Chi2", names(params), fixed = TRUE)
}
names(params) <- gsub("(c|C)hisq", "Chi2", names(params))
Expand Down
4 changes: 0 additions & 4 deletions R/methods_mass.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,8 @@ model_parameters.ridgelm <- function(model, verbose = TRUE, ...) {
parameters
}


#' @rdname model_parameters.default
#' @export
model_parameters.polr <- model_parameters.glm


#' @rdname model_parameters.default
#' @export
model_parameters.negbin <- model_parameters.glm
2 changes: 0 additions & 2 deletions R/methods_maxLik.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# .maxLik, .maxim


#' @rdname model_parameters.averaging
#' @export
model_parameters.maxLik <- model_parameters.default


#' @rdname model_parameters.averaging
#' @export
model_parameters.maxim <- model_parameters.default

Expand Down
3 changes: 1 addition & 2 deletions R/methods_mediate.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#' @rdname model_parameters.averaging
#' @export
model_parameters.mediate <- function(model, ci = 0.95, exponentiate = FALSE, verbose = TRUE, ...) {
# Parameters, Estimate and CI
Expand All @@ -13,7 +12,7 @@ model_parameters.mediate <- function(model, ci = 0.95, exponentiate = FALSE, ver

# ==== Renaming

if (any(grepl("\\(control\\)$", params$Parameter))) {
if (any(endsWith(params$Parameter, "(control)"))) {
params$Component <- gsub("(.*)\\((.*)\\)$", "\\2", params$Parameter)
}

Expand Down
1 change: 0 additions & 1 deletion R/methods_metaplus.R
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ ci.meta_random <- function(x, method = "eti", ...) {

###### .meta_fixed -------------------

#' @rdname model_parameters.averaging
#' @export
model_parameters.meta_fixed <- model_parameters.meta_random

Expand Down
7 changes: 0 additions & 7 deletions R/methods_mfx.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# model parameters ---------------------


#' @rdname model_parameters.averaging
#' @export
model_parameters.logitor <- function(model,
ci = 0.95,
Expand All @@ -25,17 +24,14 @@ model_parameters.logitor <- function(model,
}


#' @rdname model_parameters.averaging
#' @export
model_parameters.poissonirr <- model_parameters.logitor


#' @rdname model_parameters.averaging
#' @export
model_parameters.negbinirr <- model_parameters.logitor


#' @rdname model_parameters.averaging
#' @export
model_parameters.poissonmfx <- function(model,
ci = 0.95,
Expand Down Expand Up @@ -71,17 +67,14 @@ model_parameters.poissonmfx <- function(model,
}


#' @rdname model_parameters.averaging
#' @export
model_parameters.logitmfx <- model_parameters.poissonmfx


#' @rdname model_parameters.averaging
#' @export
model_parameters.probitmfx <- model_parameters.poissonmfx


#' @rdname model_parameters.averaging
#' @export
model_parameters.negbinmfx <- model_parameters.poissonmfx

Expand Down
1 change: 0 additions & 1 deletion R/methods_multcomp.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#'
#' Parameters from Hypothesis Testing.
#'
#' @rdname model_parameters.averaging
#' @param model Object of class [multcomp::glht()] (**multcomp**)
#' or of class `PMCMR`, `trendPMCMR` or `osrt` (**PMCMRplus**).
#' @inheritParams model_parameters.default
Expand Down
12 changes: 0 additions & 12 deletions R/methods_pscl.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

# model parameters -----------------

#' @rdname model_parameters.zcpglm
#' @export
model_parameters.zeroinfl <- model_parameters.zcpglm

#' @rdname model_parameters.zcpglm
#' @export
model_parameters.hurdle <- model_parameters.zcpglm


#' @rdname model_parameters.zcpglm
#' @export
model_parameters.zerocount <- model_parameters.zcpglm

Expand Down Expand Up @@ -40,11 +36,9 @@ ci.zeroinfl <- function(x,
.ci_generic(model = x, ci = ci, dof = dof, method = method, component = component, ...)
}


#' @export
ci.hurdle <- ci.zeroinfl


#' @export
ci.zerocount <- ci.zeroinfl

Expand Down Expand Up @@ -100,11 +94,9 @@ standard_error.zeroinfl <- function(model,
.filter_component(se, component)
}


#' @export
standard_error.hurdle <- standard_error.zeroinfl


#' @export
standard_error.zerocount <- standard_error.zeroinfl

Expand Down Expand Up @@ -160,11 +152,9 @@ p_value.zeroinfl <- function(model,
.filter_component(p, component)
}


#' @export
p_value.hurdle <- p_value.zeroinfl


#' @export
p_value.zerocount <- p_value.zeroinfl

Expand Down Expand Up @@ -230,10 +220,8 @@ simulate_parameters.zeroinfl <- function(model,
out
}


#' @export
simulate_parameters.hurdle <- simulate_parameters.zeroinfl


#' @export
simulate_parameters.zerocount <- simulate_parameters.zeroinfl
Loading

0 comments on commit 70cee9b

Please sign in to comment.