View source: R/calc_kurtosis.R
calc_kurtosis | R Documentation |
Functions for calculating skewness and kurtosis
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, ...)
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 |
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 )
Respectively the kurtosis and skewness of the input effect-size distribution.
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.)
For plotting skewness and kurtosis:
plot_skewness
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.