R/var_ic.R

Defines functions var_ic

Documented in var_ic

#' @export
var_ic <- function(x, ...) {
  N <- crossprod(!is.na(x))
  V <- var(x, use="pairwise.complete.obs")*(N-1)/N^2
  V[N==0] <- 0
  return(V)
}

Try the lava package in your browser

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

lava documentation built on Nov. 5, 2023, 1:10 a.m.