calc_kurtosis {QCGWAS} | R Documentation |
Skewness and Kurtosis
Description
Functions for calculating skewness and kurtosis
Usage
calc_kurtosis(input,
FRQ_val = NULL, HWE_val = NULL,
cal_val = NULL, imp_val = NULL, ...)
calc_skewness(input,
FRQ_val = NULL, HWE_val = NULL,
cal_val = NULL, imp_val = NULL, ...)
Arguments
input |
either a vector of effect sizes or a data frame using the standard column names. |
FRQ_val , HWE_val , cal_val , imp_val , ... |
arguments
passed to |
Details
Kurtosis is a measure of how well a distribution matches a
Gaussian distribution. A Gaussian distribution has a kurtosis
of 0
. Negative kurtosis indicates a flatter
distribution curve, while positive kurtosis indicates a
sharper, thinner curve.
Skewness is a measure of distribution asymmetry. A symmetrical
distribution has skewness 0
. A positive skewness
indicates a long tail towards higher values, while a negative
skewness indicates a long tail towards lower values.
Kurtosis is calculated as:
sum( (ES - mean(ES))^4) / ((length(ES)-1) * sd(ES)^4 )
Skewness is calculated as:
sum( (ES - mean(ES))^3) / ((length(ES)-1) * sd(ES)^3 )
Value
Respectively the kurtosis and skewness of the input effect-size distribution.
Note
Both functions accept vectors as input
. If input
is a data frame, the column names must match the standard
names used by QC_GWAS
("EFFECT"
for
effect sizes, "EFF_ALL_FREQ"
for allele frequency, etc.)
See Also
For plotting skewness and kurtosis:
plot_skewness
.
Examples
data("gwa_sample")
calc_kurtosis(gwa_sample$EFFECT)
calc_kurtosis(gwa_sample)
calc_kurtosis(gwa_sample$EFF_ALL_FREQ)
calc_kurtosis(gwa_sample,
FRQ_val = 0.05, cal_val = 0.95,
filter_NA = FALSE)