====== List of Macros for Skewness and Kurtosis ====== To cite, please use: Cain, M. K., Zhang, Z., & Yuan, K. (2017). Univariate and multivariate skewness and kurtosis for measuring nonnormality: Prevalence, influence and estimation. Behavior Research Methods, 49(5), 1716–1735. https://doi.org/10.3758/s13428-016-0814-1 ===== Example data ===== {{:manual:tools:eclsk563.txt|ECLS-k Data}} ===== Online calculator ===== This introduces the online tool to calculate univariate/multivariate skewness and kurtosis at http://webpower.psychstat.org/models/kurtosis/ The interface of the tool looks like {{:manual:tools:onlineinterface.jpg?450|}} ==== Data file ==== The data file can be chosen by clicking the Choose File button (it might appear differently for different browsers). We DO NOT save your data file and it is deleted immediately after calculation. ==== Type of data ==== The following types of data are allowed: * SPSS data file with the extension name .sav * SAS data file with the extension name .sas7bdat * Excel data file with the extension name .xls or .xlsx * CSV file (comma separated value data file) with extension name .csv * TXT file (text file) with extension name .txt ==== Select variables ==== A subset of variables can be used. To use the whole data set, leave this field blank. To select a subset of variables, provide the column numbers that separated by comma (,). For example 1, 2-5, 7-9, 11 will select variables 1, 2, 3, 4, 5, 7, 8, 9, 11 ==== Missing data ==== Missing data values can be provided. If multiple values are used to denote missing data, they can be separated by comma (,). For example, -999, -888, NA will replace all three values above to missing data. The output of the Web application looks like Sample size: 563 Number of variables: 4 Univariate skewness and kurtosis Skewness SE_skew Kurtosis SE_kurt V1 0.69321372 0.1029601 0.2295460 0.2055599 V2 0.03685117 0.1029601 -0.4178298 0.2055599 V3 -0.22527112 0.1029601 -0.2521029 0.2055599 V4 -1.00006618 0.1029601 1.2898344 0.2055599 Mardia's multivariate skewness and kurtosis b z p-value Skewness 2.261878 212.239506 0.00000000 Kurtosis 25.468192 2.514123 0.01193288 ===== R code ===== To use R, {{:manual:tools:mardia.r|first download our R function here}}. The input of the R code looks like eclsk <- read.table('eclsk563.txt') names(eclsk)<-c("y1", "y2", "y3", "y4") source("mardia.r") mardia(eclsk) The output looks like Sample size: 563 Number of variables: 4 Univariate skewness and kurtosis Skewness SE_skew Kurtosis SE_kurt y1 0.69321372 0.1029601 0.2295460 0.2055599 y2 0.03685117 0.1029601 -0.4178298 0.2055599 y3 -0.22527112 0.1029601 -0.2521029 0.2055599 y4 -1.00006618 0.1029601 1.2898344 0.2055599 Mardia's multivariate skewness and kurtosis b z p-value Skewness 2.261878 212.239506 0.00000000 Kurtosis 25.468192 2.514123 0.01193288 ===== SAS macro ===== [[http://support.sas.com/kb/24/983.html|A SAS macro]] can be used to calculate multivariate skewness and kurtosis. We have edited this macro to get the skewness and kurtosis only. First, download the macro to your computer, e.g., to C:\Users\johnny\. {{:manual:tools:mardia.sas|right click here to download the macro}} Second, in the sas script editor, type %inc "C:\Users\johnny\mardia.sas"; %mardia(data=testdataset, var=V2 V3) The first line provides the sas macro file location. In the second, one needs to specify the data and variables to use. An example is shown below DATA eclsk; INFILE "eclsk563.txt"; INPUT y1 y2 y3 y4; RUN; %INCLUDE "mardia.sas"; %mardia(data=eclsk, var=y1 y2 y3 y4) The sample output looks like this ### Univariate Skewness and Kurtosis ### Skewness SE_skew Kurtosis SE_kurt y1 0.6932137 0.1029601 0.229546 0.2055599 y2 0.0368512 0.1029601 -0.41783 0.2055599 y3 -0.225271 0.1029601 -0.252103 0.2055599 y4 -1.000066 0.1029601 1.2898344 0.2055599 ### Mardia's multivariate skewness and kurtosis ### Sample size = 563 Number of variables = 4 Multivariate skewness b1p = 2.2618775 z1 = 212.23951 p-value = 0 Multivariate kurtosis b2p = 25.468192 z2 = 2.514123 p-value = 0.0119329 ===== SPSS macro ===== An SPSS macro developed by [[http://www.columbia.edu/~ld208/|Dr. Lawrence T. DeCarlo]] needs to be used. We have edited this macro to get the skewness and kurtosis only. First, download the macro ({{:manual:tools:mardia.sps|right click here to download}}) to your computer under a folder such as c:\Users\johnny\. Second, open a script editor within SPSS {{:manual:tools:spss.kurtosis.4.jpg}} Third, in the script editor, type the following get data /type = txt /file = "C:\nonnormal\eclsk563.txt" /delimiters = " " /firstcase = 1 /variables = y1 f2.0 y2 f2.0 y3 f2.0 y4 f2.0. execute. INCLUDE file="C:\nonnormal\mardia.sps". mardia vars=y1 y2 y3 y4 /. execute. Note that you will need to change the folder to the SPSS macro file you just downloaded. Also, the vars to use to calculate the skewness and kurtosis should be changed to your variables. {{:manual:tools:sps.jpg}} Finally, the output is shown like Sample size: 563 Number of variables: 4 Univariate Skewness y1 y2 y3 y4 SE_skew .6932 .0369 -.2253 -1.0001 .1030 Univariate Kurtosis y1 y2 y3 y4 SE_kurt .2295 -.4178 -.2521 1.2898 .2056 Mardia's multivariate skewness b1p z1 p-value 2.2619 212.2395 .0000 Mardia's multivariate kurtosis b2p z2 p-value 25.4682 2.5141 .0119 Disclaimer: The information regarding skewness and kurtosis might be used for summary purpose in publications.