computing exercise hints

  << back

Chapter19

Exercise 1.
i) Label columns x, F(x), DF(x), EE, E, O, Z
   NAME K1 ‘X-squared’
ii)Calculate expected values
   SET x
   -1000 90:160/10 1000
   END
   CDF x F(x);
   NORMAL 129.25 13.804.
   DIFFERENCE 1 F(x) DF(x)
   LET EE = 254*DF(x)
iii) Group cells if necessary
   # Tail cells need adding together. General rule is expected values should be greater than 5    but this is not strict. Here it would be reasonable to add the two cells at each end. Too    much grouping reduces the degrees of freedom.
   # After grouping set values in column E. Also set in O the corresponding observed values.
   SUM E # a check on the total, may differ slightly because of round-off error
   # (iv) Calculate Xsquared
   LET Z = (‘O’ – ‘E’)**2/’E’
   LET ‘X-squared’ = SUM(Z))
   # Either compare with table of chi-squared percentage points or work out p-value.

Exercise 2.
# Label columns ‘y’, ‘interval’, ‘interval list’, ‘observed freq’, ‘O’, ‘x’, ‘F(x)’, ‘DF(x)’, ‘EE’, ‘E’
RANDOM 500 y;
NORMAL 0 1.
# Code values of y falling in chosen interval by centre of interval. See hint, Chap 15, 2(ii).
# Find expected values and ‘Xsquared’ as in previous hint, parts (ii), (iii) and (iv).

Exercise 3.
# Label columns ‘Br’ ‘G’ ‘Bl’
# Enter data, 4 rows in each of 3 columns.
CHISQUARE ‘Br’ ‘G’ ‘Bl’

<< back

 

 
Hodder Arnold