![normalize variable spss code normalize variable spss code](https://sariasan.com/wp-content/uploads/2019/05/normality6.jpg)
SELECT IF ANY(1,SkewnessFlag,KurtosisFlag).ĬOMPUTE CMD = CONCAT("COMPUTE ",RTRIM(VarName),".Norm = ln(",RTRIM(VarName),")."). This calculates new variables, and you will want to add a file location for the syntax file (replace the "~/" in the WRITE and INSERT commands), and change the name of the dataset referenced as 'RAWDATA' to whatever your dataset name is: USE ALL. If you omit the select data blocks after you compute the flags and replace it with this, it will calculate normalized versions of the variables that meet your criteria. VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'. In ANCOVA, the dependent variable is the post-test measure. SELECT IF ANY(Var2,'Skewness','Kurtosis').ĬOMPUTE SkewnessFlag = (Var2 = 'Skewness' AND ABS(Statistic) > 2).ĬOMPUTE KurtosisFlag = (Var2 = 'Kurtosis' AND ABS(Statistic) > 2).ĬOMPUTE VarName = CHAR.SUBSTR(Var1,1,CHAR.INDEX(Var1,' ')-1). DESTINATION FORMAT=SAV OUTFILE = 'DistributionSyntax'. INSERT FILE = ".sps", but that isn't what you asked for. If I were doing this I would go a step further and build the normalization into the syntax using WRITE OUT = ".sps" /CMD.
![normalize variable spss code normalize variable spss code](https://ded9.com/wp-content/uploads/2021/02/slide_23.jpg)
You just need to change the 'var1 TO varN' to your list of variables and whatever criteria you want for Skewness & Kurtosis on the two COMPUTE lines that create the flags, and this will do it for you.
![normalize variable spss code normalize variable spss code](https://www.spss-tutorials.com/img/spss-variable-types-and-formats-1.png)
The command below makes standardized values for mpg and weight (. There are multiple ways to approach this, so there might be an easier way. You can use the descriptives command with the save subcommand to make standardized variables.