* This SPSS syntax file helps to explore the variances of the sum and * difference of random variables. * * Last modified 09/10/03 by Tom Short. * IMPORTANT - COMPLETE THIS STEP BEFORE EXECUTING COMMANDS. * First arrow down, press Enter, or Page Down to the row representing the number * of observations you wish to generate. Place a "." in the entry in the column and row * you wish to use. * I used 50 observations for my example. * Do this in each of the first two columns in the Data View window. * I used Transform > Random Number Seed... to set a seed of my choice. SET SEED 18091003. * I used Transform > Compute... to generate data from a Normal distribution. COMPUTE var00001 = RV.NORMAL(100,10) . EXECUTE . * I used Transform > Compute... to generate some more Normal data. COMPUTE var00002 = RV.NORMAL(50,5) . EXECUTE . * I used Transform > Compute... again to find the sum and difference. COMPUTE sum = var00001+var00002 . EXECUTE . COMPUTE diff = var00001-var00002 . EXECUTE . * I chose Analyze > Descriptive Statistics > Descriptives... to explore the * means, standard deviations, and variances of the variables. DESCRIPTIVES VARIABLES=var00001 var00002 sum diff /STATISTICS=MEAN STDDEV VARIANCE . * END.