***************************************************************************** * CHAPTER 9 - STATISTICS FOR BUSINESS & ECONOMICS, 5th Edition * ***************************************************************************** * Example 9.1, p. 316 * * The present process for producing Regal Line of double-hung windows has * a mean production of 80 and the population standard deviation of SIGMA. * The random sample of productions hours is defined as N. * * The Null Hypothesis, H0, is that current process has a mean production * less than or equal to the new process. The Alternative Hypothesis is that * the new process will have a mean production greater than 80. * GEN1 SIGMA=8 GEN1 N=25 GEN1 H0=80 * * First, test the Null Hypothesis at the 5% level. From Table 1 in the * Appendix, z0.05=1.645. * GEN1 Z05=1.645 * * The GEN1 command is used to calculate the Decision Rule at the 5% level. * GEN1 DECISION=H0+Z05*(SIGMA/SQRT(N)) PRINT DECISION * * If the sample mean, XBAR, is equal to 83. The Decision Rule would be: * GEN1 XBAR=83 GEN1 DECISION=(XBAR-H0)/(SIGMA/SQRT(N)) PRINT DECISION * * The GEN1 and DISTRIB command is used to print out critical values in lieu * of referring to a statistical table. The GEN1 command is used to generate * a constant, X. The format of the DISTRIB command is: * * DISTRIB vars / options * * where: vars = list of variables * options = list of desired options * TYPE= - specifies the type of distribution * GEN1 Z=80 GEN1 VAR=(8/SQRT(25))**2 DISTRIB Z / TYPE=NORMAL MEAN=83 VAR=VAR * DELETE / ALL * ***************************************************************************** * * * Note: In this chapter, the signs of the test statistic in SHAZAM may be * * the opposite that is listed in the textbook. The opposite sign * * occurs when the sample mean is a smaller number than the mean. * * * ***************************************************************************** * *---------------------------------------------------------------------------- * Example 9.2, p. 320 * * A random sample of ball bearings is N, their mean weights is XBAR, and the * standard deviation is SIGMA, and the Null Hypothesis is H0. * GEN1 N=16 GEN1 XBAR=4.962 GEN1 SIGMA=0.1 GEN1 H0=5 * * The Null Hypothesis is that the population mean weight is equal to 5 ounces * and the Alternative Hypothesis is that it is less than 5 ounces. * * First, test the Null Hypothesis at the 5% level. From Table 1 in the * Appendix, z0.05=1.645 * GEN1 Z05=1.645 * * The GEN1 command is used to calculate the Decision Rule formula on page 331 * at the 5% level. * GEN1 DECISION=(XBAR-H0)/(SIGMA/SQRT(N)) PRINT DECISION * GEN1 SIGMA2=(SIGMA/SQRT(N))**2 GEN1 Z=5.0 DISTRIB Z / TYPE=NORMAL MEAN=XBAR VAR=SIGMA2 * DELETE / ALL *---------------------------------------------------------------------------- * Example 9.3, p. 322 * * The random sample of drilled hole measurements is N, the mean diameter is * XBAR, standard deviation is SIGMA and the Null Hypothesis is H0. * GEN1 N=9 GEN1 XBAR=1.95 GEN1 SIGMA=0.06 GEN1 H0=2 * * The Null Hypothesis, H0, is that the population mean is 2 inches and the * Alternative Hypothesis that it is not. At the 5% level of significance * z0.025=1.96. * GEN1 DECISION=(XBAR-H0)/(SIGMA/SQRT(N)) PRINT DECISION * GEN1 VAR=(SIGMA/SQRT(N))**2 GEN1 ZZ=2.0 DISTRIB ZZ / TYPE=NORMAL MEAN=XBAR VAR=VAR * DELETE / ALL *---------------------------------------------------------------------------- * Example 9.4, p. 325 * * The random sample of sales data from stores is N, the sales mean is MEAN, * the standard deviation is S, and the Null Hypothesis is H0. * READ(BROCCOLI.DIF) / DIF LIST * * The STAT command is used to print the descriptive statistic about the * variable BROCCOLI. The MEAN= option stores the means as a vector * in the variable called MEAN. The STD= option stores standard deviation * as a vector in the variable called S. * STAT BROCCOLI / MEAN=MEAN STD=S GEN1 N=134 GEN1 H0=2400 * * The Null Hypothesis, H0, is that the population mean sales are 2400 * the Alternative is that the sales have increased significantly greater * than 2400. * GEN1 STAT=(MEAN-H0)/(S/SQRT(N)) PRINT STAT * GEN1 VAR=(4919/SQRT(N))**2 GEN1 Z=2400 DISTRIB Z / TYPE=NORMAL MEAN=3593 VAR=VAR GEN1 X=0.05 DISTRIB X / TYPE=T DF=133 INVERSE * DELETE / ALL *---------------------------------------------------------------------------- * Example 9.5, p. 329 * * A random sample of supermarket shoppers is N and the percentage of these * shoppers that were able to state the correct price of an item immediately * after putting it into the shopping cart is PX. The Null Hypothesis, P0, is * that at least one-half of all shoppers are able to state the correct price. * The Alternative Hypothesis is that less than one-half is able to state the * correct price. * GEN1 N=802 GEN1 PX=378/N GEN1 P0=0.50 * * The Null Hypothesis is tested at the 10% level of significance with the * GEN1 command. * GEN1 STAT=(PX-P0)/SQRT((P0*(1-P0))/N) PRINT STAT * GEN1 VAR=(SQRT((P0*(1-P0))/N))**2 DISTRIB P0 / TYPE=NORMAL MEAN=0.471 VAR=VAR * DELETE / ALL *---------------------------------------------------------------------------- * Example 9.6, p. 332 * * A random sample of fertilizers is N, the sample variance in impurity level * percentage is S2, the Null Hypothesis, H0, that the population variance of * impurity concentrations, SIGMA2, is no more than 4. * GEN1 N=20 GEN1 S2=6.62 GEN1 SIGMA2=4 * * The test of significance at the 10% level is calculated with the GEN1 * command. * GEN1 STAT=((N-1)*S2)/SIGMA2 PRINT STAT * GEN1 X=0.05 DISTRIB X / TYPE=CHI DF=19 INVERSE * DELETE / ALL *---------------------------------------------------------------------------- * Example 9.7, p. 335 * * The SAMPLE command is used to change the current sample range to the * new sample range based on the Brain Wave Measurements data. Product * Observation is OBS, the High Recall of Commercials is X and the Low * Recall of Commercials is Y. * SAMPLE 1 10 READ OBS X Y 1 141 55 2 139 116 3 87 83 4 129 88 5 51 36 6 50 68 7 118 91 8 161 115 9 61 90 10 148 113 GEN1 N=10 * * The GENR command is used to generate a vector of the difference between * High Recall X and Low Recall Y defined as DIFF. * GENR DIFF=X-Y * * The STAT command computes the descriptive statistics of the variables * specified. The MEANS= option stores the means as a vector called MEAN * and the STDEV= option stores the standard deviations as a vector called * STD. * STAT X Y DIFF / MEAN=MEAN STDEV=STD * * The GEN1 function with the MEAN:3 and STD:3 tells SHAZAM to extract the * value in Row 3 of the vector MEAN and STD for the calculation. The value * stored in Row 3 reflects the mean and standard deviation of the variable * DIFF. The order of the saved values in the vector for the mean and * standard deviation are directly correlated with the order in which the * variables are specified in the previous STAT command. * GEN1 T=MEAN:3/(STD:3/SQRT(N)) PRINT MEAN:3 STD:3 T * GEN1 Z=0.05 DISTRIB Z / TYPE=T DF=9 INVERSE * DELETE / ALL *---------------------------------------------------------------------------- * Example 9.8, p. 338 * * The randomly selected fields with cow manure applied is NY, their sample * mean productivity is YBAR, and the variance in productivity is SIGMA2Y. * The second randomly selected fields with turkey dung applied is NX, their * sample mean productivity is XBAR, and the variance in productivity is * SIGMA2X. * GEN1 NY=25 GEN1 YBAR=100 GEN1 SIGMA2Y=400 GEN1 NX=25 GEN1 XBAR=115 GEN1 SIGMA2X=625 * * The Null Hypothesis is that the two population means are less than or * equal to zero. The Alternative Hypothesis that the true mean is greater * than zero. * GEN1 STAT=(XBAR-YBAR)/(SQRT((SIGMA2X/NX)+(SIGMA2Y/NY))) PRINT STAT * GEN1 SIG2=(SQRT((SIGMA2X/NX)+(SIGMA2Y/NY)))**2 DISTRIB YBAR / TYPE=NORMAL MEAN=XBAR VAR=SIG2 * DELETE / ALL *---------------------------------------------------------------------------- * Example 9.9, p. 341 * * A random sample of Mondays and Saturdays from a population of several * years aof data is defined as NM AND NS. The sample mean and deviation * for the sample of Mondays and Saturdays is XBARM, SM, YBARS, SS. * GEN1 XBARM=1078 GEN1 SM=633 GEN1 NM=25 GEN1 YBARS=908.2 GEN1 SS=469.8 GEN1 NS=25 * * First, the pooled variance S2P is calculated with the GEN1 command. * GEN1 S2P=(((NM-1)*(SM**2))+((NS-1)*(SS**2)))/(NM+NS-2) PRINT S2P * * The test statistic, T, is calculated next with the GEN1 command. * GEN1 T=(XBARM-YBARS)/(SQRT((S2P/NM)+(S2P/NS))) PRINT T * GEN1 SIGMA2=(SQRT((S2P/NM)+(S2P/NS)))**2 DISTRIB YBARS / TYPE=NORMAL MEAN=XBARM VAR=SIGMA2 GEN1 ALPHA=0.05 DISTRIB ALPHA / TYPE=T DF=48 INVERSE * DELETE / ALL *---------------------------------------------------------------------------- * Example 9.10, p. 341 * * Recall from Example 9.7, the SAMPLE command is used to change the current * sample range to the new sample range of the Brain Wave Measurements data. * Product Observation is OBS, the High Recall of Commercials is X and the * Low Recall of Commercials is Y. * SAMPLE 1 10 READ OBS X Y 1 141 55 2 139 116 3 87 83 4 129 88 5 51 36 6 50 68 7 118 91 8 161 115 9 61 90 10 148 113 * * The GEN1 command is first used to generate a constant for the number * of obervations for the High and Low Recall of Commercials. As in * Example 9.7, the GENR command is used to generate a vector for the * differences between High and Low Recall. The STAT command with the * MEAN= and STDEV= options saves the mean and standard deviations of the * variables specified. * GEN1 NX=10 GEN1 NY=10 GENR DIFF=X-Y STAT X Y DIFF / MEAN=MEAN STDEV=STD * * First, the pooled variance estimate is calculated and stored in the * constant VAR and then the test statistic, T, is calculated. * GEN1 VAR=(((NX-1)*(STD:1**2))+((NY-1)*(STD:2**2)))/(NX+NY-2) GEN1 T=MEAN:3/SQRT((VAR/NX)+(VAR/NY)) PRINT VAR T * GEN1 SIGMA2=(SQRT(((STD:1**2)/NX)+((STD:2**2)/NY)))**2 GEN1 M=MEAN:2 DISTRIB M / TYPE=NORMAL MEAN=MEAN:1 VAR=SIGMA2 GEN1 ALPHA=0.05 DISTRIB ALPHA / TYPE=T DF=18 INVERSE * DELETE / ALL *---------------------------------------------------------------------------- * Example 9.11, p. 348 * * An independent random sample of American trade magazine advertisements * is NY and the ratio of these magazines that are humourous is PX. The * independent random sample of British trade magazine advertisements is * NX and the ratio of these magazines that are humourous is PY. * GEN1 NX=203 GEN1 PX=52/NX GEN1 NY=270 GEN1 PY=56/NY * * The Null Hypothesis is that the proportion of all British and American * trade magazine advertisements that are humourous are the same. * * First, the estimate of the common proportion under the Null Hypothesis, * P0, must be calculated with the GEN1 command. * GEN1 P0=((NX*PX)+(NY*PY))/(NX+NY) * * Then P0 is used in the test statistic calculation. * GEN1 STAT=(PX-PY)/(SQRT(P0*(1-P0)*((NX+NY)/(NX*NY)))) PRINT P0 STAT * GEN1 SIGMA2=((SQRT(P0*(1-P0)*((NX+NY)/(NX*NY)))))**2 DISTRIB PX / TYPE=NORMAL MEAN=PY VAR=SIGMA2 * DELETE / ALL *---------------------------------------------------------------------------- * Example 9.12, p. 352 * * A random sample of newly issued AAA-rated bonds is NX and the sample * variance is SX2. An independent random sample of CCC-rated bonds is NY * and its sample variance is SY2. * GEN1 NX=17 GEN1 SX2=123.35 GEN1 NY=11 GEN1 SY2=8.02 * * The Null Hypothesis tests that the population variances are equal. * GEN1 FSTAT=SX2/SY2 PRINT FSTAT * GEN1 X=0.01 DISTRIB X / TYPE=F DF1=16 DF2=10 INVERSE * DELETE / ALL *---------------------------------------------------------------------------- * Example 9.13, p. 358 * * The proportionof forecasts that exceed the actual earnings level is M, * the random sample of forecasts is N, and the number that exceeded actual * earnings is ACT. * GEN1 M=0.50 GEN1 N=600 GEN1 ACT=382 * * Null Hypothesis is rejected if PX is greater than PX1 and less than PX2. * GEN1 PX1=M+1.96*(SQRT((M*M)/N)) GEN1 PX2=M-1.96*(SQRT((M*M)/N)) PRINT PX1 PX2 * * Observed sample proportion is defined as PX with the GEN1 command. The * true population proportion is defined a M1. * GEN1 PX=ACT/N GEN1 M1=0.55 * * Given that the true population proportion is M1=0.55, probability that the * sample proportion is between PX1 and PX2 is calculated using the GEN1 * command. * GEN1 LOWER=(PX2-M1)/SQRT((M1*(1-M1))/N) GEN1 UPPER=(PX1-M1)/SQRT((M1*(1-M1))/N) PRINT LOWER UPPER * * The Power of the Test is calculated with the GEN1 command. From Table 1 * of the Appendix, Z=0.49, F(Z)=0.6879. Therefore, BETA is 1-F(Z). * GEN1 BETA=0.3121 GEN1 POWER=1-BETA PRINT POWER * DELETE / ALL *---------------------------------------------------------------------------- STOP