Chapter 12 - STATISTICS FOR BUSINESS & ECONOMICS by Paul Newbold
*****************************************************************************
* CHAPTER 10 - STATISTICS FOR BUSINESS & ECONOMICS, 4th Ed., by Paul Newbold*
*****************************************************************************
*
* Example 10.1, page 388
*
* A random sample of children is N, the number of these children that
* preferred peanut butter ripple ice cream is PB, the number of these
* children that preferred bubblegum surprise is BS, and the number of these
* children that expressed no preference is NP.
*
GEN1 N=100
GEN1 PB=56
GEN1 BS=40
GEN1 NP=4
*
* The Null Hypothesis is that there is no overall preference in this
* population for one flavor over the other.  Before the analysis can be
* performed, the sample of children that expressed no preference must be
* subtracted from the original sample size to yield the group of children
* that gave a response for either ice cream flavours.
*
GEN1 N=N-NP
*
* The sample proportion preferring peanut butter ripple is defined as PXHAT.
*
GEN1 PXHAT=PB/N
PRINT PXHAT
*
* The test statistic is then calculated using the GEN1 command.
*
GEN1 STAT=(PXHAT-0.5)/(SQRT((0.5)**2/N))
PRINT STAT
*
DELETE / ALL
*
*----------------------------------------------------------------------------
* Example 10.2, page 393
*
* A sample of thirty-one matched pairs of firms is N.  The smaller of the
* rank sums, 189, was for those pairs where the ratio was higher for the
* firm without sophisticated postaudit procedures is T.
*
GEN1 N=31
GEN1 T=189
*
* The Wilcoxon statistic under the Null Hypothesis that the distribution of
* differences in ratios is centered on 0 against the Alternative Hypothesis
* that the ratio of market valuation to replacement cost of assets tends to
* be lower for firms without sophisticated postaudit procedures.
*
* First the Mean of T is calculated.  Then the Variance of T and the Standard
* Deviation of T.
*
GEN1 MEANT=(N*(N+1))/4
GEN1 SIGMA2T=(N*(N+1)*(2*N+1))/24
GEN1 SIGMAT=SQRT(SIGMA2T)
*
* The Wilcoxon Statistic is calculated using the previously determined Mean
* and Standard Deviaton of T.
*
GEN1 WILCOXON=(T-MEANT)/SIGMAT
PRINT MEANT SIGMA2T SIGMAT WILCOXON
*
DELETE / ALL
*
*----------------------------------------------------------------------------
* Example 10.3, page 398
*
* A random sample of the performance of firms that does not give management
* forecasts of earnings is defined as N1 and a random sample of the
* performance of firms that give management forecasts of earnings is defined
* as N2.  The sum of the ranks for firms not disclosing management earnings
* forecasts is defined as R1.
*
GEN1 N1=80
GEN1 N2=80
GEN1 R1=7287
*
* The Null Hypothesis is that the central locations of the population
* distributions of earnings variabilities are the same for the two types of
* firms.
*
* The Mann-Whitney statistic is calculated with the GEN1 command.
*
GEN1 U=(N1*N2)+((N1*(N1+1))/2)-R1
PRINT U
*
* The Mean, Variance and Standard Deviation of the Mann-Whitney statistic is:
*
GEN1 MEANU=(N1*N2)/2
GEN1 SIGMA2U=(N1*N2*(N1+N2+1))/12
GEN1 SIGMAU=SQRT(SIGMA2U)
PRINT MEANU SIGMA2U SIGMAU
*
* The Decision Rule is:
*
GEN1 DR=(U-MEANU)/SIGMAU
PRINT DR
*
DELETE / ALL
*
*-----------------------------------------------------------------------------
*
STOP