preserve. set printback=on. * MEAN, VARIANCE AND STANDARD DEVIATION: POPULATION AND SAMPLE * ORIGINAL AND STANDARDIZED VARIABLES Valentim R. Alferes, University of Coimbra (Portugal), 2016. * Program: BasicStatistics.sps. set printback=off. set ovars labels onumbers values tvars labels tnumbers values. set olang=English small=0 errors=none decimal=dot. data list free/VarX(f8.2). /* User's Specifications /* * Enter our data. begin data 20.4 16.0 13.8 15.0 18.3 13.9 14.0 13.5 end data. compute k=1. execute. aggregate/outfile=* mode=addvariables/break=k /varx_mean=mean(varx)/varx_sd=sd(varx)/N=N. compute VARsam=VarX_sd**2. compute VARpop=((N-1)/N)*VarX_sd**2. compute DPpop=sqrt(VARpop). compute VarZ=(VarX-VarX_mean)/VarX_sd. execute. formats all(f8.4) N(f8.0). oms/select tables/if commands=["summarize"] subtypes=["case processing summary"]/destination viewer=no. variable labels varx_mean'Mean' varpop'Variance' dppop'Std. Deviation' varx_mean'Mean' varsam'Variance' varx_sd'Std. Deviation'. summarize/tables=n varx_mean varpop dppop /format=list nocasenum nototal limit=1 /title='Population Statistics (descriptive statistics)' /footnote='N is the denominator of the mean and the variance.'/cells=none. summarize/tables=n varx_mean varsam varx_sd /format=validlist nocasenum nototal limit=1 /title='Sample Satistics (inferential statistics)' /footnote='N is the denominator of the mean; (N-1) is the denominator of '+ 'the variance. This is the default SPSS output.'/cells=none. summarize/tables=varx varz/format=list nocasenum nototal /title='Original (VarX) and Standardized (VarZ) Variabels' /footnote='See variables VarX and VarZ in the file "Variables.sav" on our '+ 'Desktop.'/cells=count mean var stddev. delete variables k VarX_mean VarX_sd N VARsam VARpop DPpop. save outfile='%userprofile%\desktop\Variables.sav'. get file='%userprofile%\desktop\Variables.sav'. restore.