***************************************************************************** * CHAPTER 2 - STATISTICS FOR BUSINESS AND ECONOMICS, 5th Edition * ***************************************************************************** * Example 2.1, p. 14 * * Read this example carefully. Be sure you understand the methodology. * *---------------------------------------------------------------------------- * Example 2.1 - Revisited (Frequency Distributions), p. 17 * * The SAMPLE command specifies the beginning and ending observation. The * format of the command is: * * SAMPLE beg end * * where: beg = the beginning observation * end = the ending observation * SAMPLE 1 100 * * The READ command inputs the data and assigns variable names. The format * of the READ command is: * * READ vars / options * * where: var = is a list of variable names * options = is a list of desired options * * The LIST option is used on the READ command to list all the data that has * been read. * * The Production Rate is defined as PACKAGES in the 1000s. * READ(SUNTAN.DIF) / DIF * * Replicate Table 2.1, p. 15 * * The PRINT command lists variables specified. The format of the command is: * * PRINT vars / options * * where: vars = a list of variables * options = a list of desired options * PRINT WEIGHTS * * The output below is slightly different that the textbook since SHAZAM * uses a different base for the data. * * The STAT command prints the descriptive statistics of the variable(s) * specified. The PFREQ option prints a table of frequencies of occurrence * for each observed value in the data. The format of the STAT command is: * * STAT vars / options * * where: var = is a list of variable names * options = is a list of desired options * STAT WEIGHTS / PFREQ * * Plot Figure 2.2, p. 18 * GRAPH WEIGHTS / HISTO GROUPS=6 NONPAR WEIGHTS / DENSITY GRAPH * DELETE / ALL *---------------------------------------------------------------------------- * Example 2.2, p. 20 * SAMPLE 1 25 READ(GILOTTI.DIF) / DIF PRINT MINUTES * * The STEMPLOT=1 option on the STAT command prints the stemplot with a 1 * digit stem. * STAT MINUTES / STEMPLOT=1 * DELETE / ALL *---------------------------------------------------------------------------- * Example 2.3, p. 21 * SAMPLE 1 112 READ(AGPAS.DIF) / DIF PRINT GPAS STAT GPAS / STEMPLOT=2 * DELETE / ALL *---------------------------------------------------------------------------- * Example 2.4, p. 22 * * SHAZAM's results are different than the textbook due to the rounding method * used. * SAMPLE 1 6 READ MILES 357 153 156 242 310 557 STAT MILES / STEMPLOT=1 * DELETE / ALL *---------------------------------------------------------------------------- * Example 2.5, p. 23 * * Read this example carefully. Be sure you understand the methodology. * *---------------------------------------------------------------------------- * Example 2.6, p. 27 * * Read this example carefully. Be sure you understand the methodology. * *---------------------------------------------------------------------------- * Example 2.7, p. 27 * SAMPLE 1 120 READ(INSURANCE.DIF) / DIF * * The Category and Frequency from Table 2.5 is printed with the STAT command * PFREQ option. * STAT INSURANC / PFREQ *---------------------------------------------------------------------------- * Example 2.8, p. 29 * * Read this example carefully. Be sure you understand the methodology. * *---------------------------------------------------------------------------- * Example 2.9, p. 32 * SAMPLE 1 5 READ TIMES 45 53 45 50 48 * * The STAT command automatically prints the MEAN of the variable specified. * The MEAN= option stores the mean in the variable MEAN and the MEDIAN= * option stores the median in the variable MEDIAN. * STAT TIMES / MEAN=MEAN MEDIAN=MEDIAN * * The PRINT command is used to list variables specified. The format of the * PRINT command is: * * PRINT vars / options * * where: vars = is a list of variable names * options = is a list of desired options * PRINT MEAN MEDIAN * *---------------------------------------------------------------------------- * Example 2.10, p. 33 * SAMPLE 1 36 READ(BISHOP.DIF) / DIF *STAT DOLLARS PRICE QUANTITY * * Table 2.6, p. 33 * PRINT DOLLARS * *Figure 2.14, p. 34 * STAT DOLLARS / STEMPLOT=2 MODES=MODE PRINT MODE * * Application to Suntan Lotion Example, p. 34 * SAMPLE 1 100 READ(SUNTAN.DIF) / DIF * * The "&" option is used to continue the SHAZAM command line to the next line. * The MODES= option stores the MODES as a vector in the variable MODE. The * STDEV= option stores the standard deviations as a vector in the variable * STDDEV. The VAR= option stores the variances as a vector in the variable * VARIANCE. The MINIM= and MAXIM= option stores the minimums and maximums * in the vector MINIMUM and MAXIMUM. The SUMS= option stores the sum of * each variable in the vector SUM. * STAT WEIGHTS / MEAN=MEAN MEDIANS=MEDIAN MODES=MODE STDEV=STDDEV VAR=VARIANCE & MINIM=MINIMUM MAXIM=MAXIMUM SUMS=SUM * * Figure 2.15, p. 34 * * The number of observations for the variable WEIGHTS is stored in the * temporary variable $N. * PRINT MEAN MEDIAN MODE STDDEV VARIANCE MINIMUM MAXIMUM SUM $N * *---------------------------------------------------------------------------- * Example 2.11, p. 36 * SAMPLE 1 5 READ FAXES 20 73 75 80 82 STAT FAXES / MEAN=MEAN MEDIAN=MEDIAN PRINT MEAN MEDIAN * * --------------------------------------------------------------------------- * Example 2.12, p. 36 * GEN1 AGR=1.05**5 GEN1 GM=1.25**(1/5) PRINT AGR GM * DELETE / ALL *---------------------------------------------------------------------------- * Example 2.13, p. 40 * SAMPLE 1 5 READ CLASS1 CLASS2 / BYVAR LIST 50 60 70 80 90 72 68 70 74 66 STAT CLASS1 CLASS2 / MEAN=MEAN MEDIANS=MEDIAN STDEV=STDEV VAR=VAR MINIM=MIN & MAXIM=MAX SUM=SUM PRINT MEAN MEDIAN STDEV VAR MIN MAX SUM $N * *---------------------------------------------------------------------------- * Example 2.14, p. 41 * * Read this example carefully. Be sure you understand the methodology. * *---------------------------------------------------------------------------- * Example 2.15, p. 42 * GEN1 SA=2.00 GEN1 SB=8.00 GEN1 XBARA=4.00 GEN1 XBARB=80.00 GEN1 CVA=(SA/XBARA)*100 GEN1 CVB=(SB/XBARB)*100 PRINT CVA CVB * *---------------------------------------------------------------------------- * Example 2.16, p. 44 * SAMPLE 1 25 READ(GILOTTI.DIF) / DIF PRINT MINUTES * * The PMEDIAN option on the STAT command prints out the mode and quartiles * of the variables specified. The STEMPLOT=1 option prints the stemplot * with a 1 digit stem. * STAT MINUTES / PMEDIAN STEMPLOT=1 * DELETE / ALL *---------------------------------------------------------------------------- * Example 2.17, p. 46 * * Read this example carefully. Be sure you understand the methodology. * *---------------------------------------------------------------------------- * Example 2.18, p. 48 * SAMPLE 1 6 READ ERROR PAGES / LIST 0 102 1 138 2 140 3 79 4 33 5 8 GENR TE=ERROR*PAGES STAT TE / SUMS=TOTALE GEN1 MEAN=TOTALE/500 GENR VAR=PAGES*((ERROR-MEAN)**2) STAT VAR / SUMS=VAR1 PRINT TOTALE VAR1 GEN1 POPVAR=VAR1/500 GEN1 STD=SQRT(POPVAR) PRINT MEAN POPVAR STD * DELETE / ALL *---------------------------------------------------------------------------- * Example 2.19, p. 50 * SAMPLE 1 5 READ CLASS M F FM FM2 / LIST 02 1 2 2 2 24 3 3 9 27 46 5 6 30 150 68 7 5 35 245 810 9 4 36 324 STAT F / SUMS=N STAT FM / SUMS=SFM STAT FM2 / SUMS=SFM2 PRINT N SFM SFM2 GEN1 XBAR=SFM/N GEN1 VAR=(SFM2-(N*XBAR**2))/(N-1) GEN1 S=SQRT(VAR) PRINT XBAR VAR S * STOP