R/qc.R

Defines functions qc

Documented in qc qc

qc <- function(x, y, tau) {
  n   <- length(y)
  k   <- length(tau)
  rho <- NULL
  for(i in 1:k) {
    ytau   <- as.numeric(stats::quantile(y, probs=tau[i]))
    psiy   <- rep(tau[i], n) - I(y - ytau<0)
    rho[i] <- (x-mean(x)) %*% psiy / (n * sqrt(tau[i] - tau[i]^2) * stats::sd(x)) 
  }
  return(list(tau = tau, rho = rho))
}

Try the QCSIS package in your browser

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

QCSIS documentation built on May 1, 2019, 9:17 p.m.