R/calc_kurtosis.R

Defines functions calc_kurtosis

Documented in calc_kurtosis

calc_kurtosis <-
function(input, FRQ_val = NULL, HWE_val = NULL, cal_val = NULL, imp_val = NULL, ...) {
  if(!is.null(c(FRQ_val, HWE_val, cal_val, imp_val))) { effect <- input$EFFECT[HQ_filter(data = input, FRQ_val = FRQ_val, HWE_val = HWE_val, cal_val = cal_val, imp_val = imp_val, ...)]
  } else { if(is.vector(input)) { effect <- input } else { effect <- input$EFFECT } }
  if(any(is.na(effect))) { effect <- effect[!is.na(effect)] }
  return(if(length(effect) == 0L) { NA } else { sum( (effect - mean(effect))^4) / ((length(effect)-1) * sd(effect)^4 ) } )
}

Try the QCGWAS package in your browser

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

QCGWAS documentation built on May 30, 2022, 5:05 p.m.