https://github.com/cran/metafor
Tip revision: 5e080e28c25477c201792f082375d718b86ed758 authored by Wolfgang Viechtbauer on 28 March 2024, 16:00:06 UTC
version 4.6-0
version 4.6-0
Tip revision: 5e080e2
coef.rma.r
coef.rma <- function(object, ...) {
mstyle <- .get.mstyle()
.chkclass(class(object), must="rma")
ddd <- list(...)
coefs <- c(object$beta)
names(coefs) <- rownames(object$beta)
if (isTRUE(ddd$type=="beta"))
return(coefs)
if (inherits(object, "rma.ls")) {
coefs <- list(beta=coefs)
coefs$alpha <- c(object$alpha)
names(coefs$alpha) <- rownames(object$alpha)
if (isTRUE(ddd$type=="alpha"))
return(coefs$alpha)
}
if (inherits(object, "rma.uni.selmodel")) {
coefs <- list(beta=coefs)
coefs$delta <- c(object$delta)
if (length(object$delta) == 1L) {
names(coefs$delta) <- "delta"
} else {
names(coefs$delta) <- paste0("delta.", seq_along(object$delta))
}
if (isTRUE(ddd$type=="delta"))
return(coefs$delta)
}
return(coefs)
}