R/strRegression-s-p-cor-dot.R

Defines functions .SPCor

#' Semipartial Correlation
#'
#' @author Ivan Jacob Agaloos Pesigan
#'
#' @param betastar Numeric vector.
#'   Standardized regression slopes.
#' @param sigmacapx Numeric matrix.
#'   Covariance matrix of
#'   \eqn{\left\{ X_{1}, \dots, X_{p} \right\}^{\prime}}.
#'
#' @family Semipartial Correlation Functions
#' @keywords strRegression spcor internal
#' @noRd
.SPCor <- function(betastar,
                   sigmacapx) {
  return(
    betastar * sqrt(
      1 / diag(
        chol2inv(
          chol(
            .RhoofSigma(
              x = sigmacapx,
              q = 1 / sqrt(diag(sigmacapx))
            )
          )
        )
      )
    )
  )
}

Try the betaSandwich package in your browser

Any scripts or data that you put into this service are public.

betaSandwich documentation built on Oct. 15, 2023, 1:07 a.m.