home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / e / estat21.zip / EASIDOC.ZIP / ESCHAP06.DOC < prev    next >
Text File  |  1992-06-30  |  43KB  |  1,189 lines

  1.  
  2.  
  3.      Chapter 6: STATISTICAL COMMANDS
  4.  
  5.      In this chapter the statistical commands available are
  6.      described. This manual does not seek to replace a
  7.      statistics textbook, so only minimal guidance will be
  8.      given as to which tests are appropiate for which data.
  9.      The field is complex and controversial and if the user is
  10.      not sure which test to use he or she should consult a
  11.      textbook or professional statistician for guidance.
  12.  
  13.      Broadly speaking the tests may be divided according to
  14.      whether they deal with parametric, nonparametric or
  15.      categorical data. Data which is parametric should be
  16.      continuous rather than discrete, and ideally should
  17.      follow a normal distribution though different tests are
  18.      more or less robust to departures from normality. It
  19.      should be like the markings on a ruler in that the
  20.      distance between each pair of consecutive numbers is
  21.      always equal, with the proviso that to satisfy the
  22.      requirement that the data is continuous the "marks"
  23.      should be close together. Nonparametric data need not be
  24.      so distributed, but the values must be ordinal in the
  25.      sense that it is always possible to say that one value is
  26.      greater than another. All the nonparametric tests
  27.      supplied, Wilcoxon's rank sum, Wilcoxon's signed rank,
  28.      Kendall's rank correlation coefficient, the Kruskall-
  29.      Wallis test and the Kolmogorov-Smirnov test work by first
  30.      assigning ranks to the values and then comparing ranks
  31.      rather than the values themselves. Categorical
  32.      information lacks even this quality of being ordered, so
  33.      that one can simply say that a quality is different, but
  34.      not greater or less than another.
  35.  
  36.      Parametric data might include height, weight, blood
  37.      pressure, temperature. It is often acceptable to apply it
  38.      to age in years provided that the total age range is
  39.      reasonably large since then it can approximate to a
  40.      continuous distribution.
  41.  
  42.      Nonparametric data would include age if it were broken
  43.      down by decades, an assessment scale with only five
  44.      points, social class, rank score on a measure, number of
  45.      children, etc.
  46.  
  47.      Categorical data might include gender, marital status,
  48.      ethnic origin, etc.
  49.  
  50.      It is always possible to treat parametric data as if it
  51.      were nonparametric, and any data may be treated as
  52.      categorical. However if the data is distributed such that
  53.      a parametric test is feasible, this should be used in
  54.      preference to a nonparametric one since the parametric
  55.      test will have more power, i.e. the nonparametric test
  56.      might produce a spuriously negative result. However if
  57.      the data is nonparametric then the nonparametric test
  58.      should be used, since otherwise spuriously positive or
  59.      negative results may be produced. Unless there are good
  60.      reasons to use cut-off points to divide ordinal data into
  61.      categories, categorical tests should not be used on
  62.      ordinal data because power will be lost and spuriously
  63.      negative results can occur.
  64.  
  65.      
  66.        50 
  67.         Statistical commands  
  68.      
  69.      No specific test of normality is provided, and the user's
  70.      understanding of the nature of the quantity which the
  71.      data measures is crucial. However examining the frequency
  72.      distribution, skewness and kurtosis may be helpful, and
  73.      also note should be taken of how closely together lie the
  74.      mean, median and mode. If they are far apart then the
  75.      data must be skewed. Sometimes data which is quite non-
  76.      normally distributed can be converted to data that more
  77.      closely follows a normal distribution by applying a
  78.      mathematical transformation. One of these is simply to
  79.      take the log of the value. Other suggestions are
  80.      described in textbooks.
  81.  
  82.      The chi-squared test compares data divided into
  83.      categories in two different ways. The Wilcoxon rank sum
  84.      test compares nonparametric data between two groups
  85.      defined categorically, as does the Kolmogorov-Smirnov
  86.      test. The Kruskall-Wallis one way analysis of variance
  87.      does the same for more than two groups. The Wilcoxon
  88.      signed rank sum test can be used to compare pairs of
  89.      measures in two different columns. Kendall's rank
  90.      correlation coefficient compares the relationship of two
  91.      nonparametric measures. Student's t test compares a
  92.      parametric measure in two groups defined categorically,
  93.      and the analysis of variance does the same thing with
  94.      more than two groups. The standard (Pearson's)
  95.      correlation coefficient with linear regression compares
  96.      data from two parametric measures. Multiple linear
  97.      regression compares data from one parametric measure with
  98.      data from several other parametric measures (though for
  99.      some purposes this requirement may be relaxed, for
  100.      example in discriminant analysis). Principal components
  101.      analysis analyses data from several measures, which are
  102.      all taken to be parametric. Finally a general purpose
  103.      minimisation routine is provided, which can be used to
  104.      perform non-linear regression and other optimisation
  105.      problems.
  106.  
  107.  
  108.      6:1. Basics
  109.  
  110.      Format: B[asics] [r[anks]] [g[raphfile]] column [if
  111.      condition]
  112.  
  113.      Outputs basic information about the data in a column -
  114.      the total of the values in the column and the number of
  115.      items, and the mean, mode, median, minimum, maximum,
  116.      variance, standard deviation, standard error of the mean,
  117.      skewness and kurtosis. Optionally a frequency and rank
  118.      table of the values may also be produced. The graphing
  119.      option allows a frequency distribution or cumulative
  120.      distribution to be displayed in a histogram as described
  121.      in the relevant section of the EASIGRAF documentation
  122.      (although for some variables the graphing option of the
  123.      CHISQ command may be more suitable).
  124.  
  125.      Select command -  BASICS C15
  126.  
  127.      Select command -  BAS C15 IF ROW<=50
  128.  
  129.  
  130.  
  131.      
  132.        51 
  133.         Statistical commands  
  134.      
  135.      Select command -  b ranks c19
  136.  
  137.      Example output:
  138.  
  139.      A  -  C19
  140.      Column total=269.0 Number of items=100
  141.      Mean=2.690
  142.      Minimum=0.0   Maximum=7.0
  143.      Mode=0.0   Median=3.0
  144.      Variance=5.314  Population variance=5.368
  145.      Standard deviation=2.305 Population standard deviation=2.317
  146.      Standard error of mean=0.231
  147.  
  148.      No.      Rank    %     Cum%   Value
  149.         30     15.5   30.0   30.0   0.000000
  150.          8     34.5    8.0   38.0   1.000000
  151.          9     43.0    9.0   47.0   2.000000
  152.         15     55.0   15.0   62.0   3.000000
  153.         14     69.5   14.0   76.0   4.000000
  154.          7     80.0    7.0   83.0   5.000000
  155.         12     89.5   12.0   95.0   6.000000
  156.          5     98.0    5.0  100.0   7.000000
  157.  
  158.      Comments
  159.  
  160.      Further detail about the syntax of the BASICS command is
  161.      provided in the general section on command syntax.
  162.  
  163.      If confidence limits have been requested (using the
  164.      LIMITS command) then upper and lower confidence limits
  165.      for the population mean will also be output.
  166.  
  167.      If there is more than one mode then only the lowest will
  168.      be output. If you suspect there may be more than one then
  169.      you can either look at the frequency table or can issue
  170.      the BASICS command again together with a condition which
  171.      excludes the first mode found, e.g. if a mode of 1.5 is
  172.      reported:
  173.  
  174.      Select command -  b c19 if c19!=1.5
  175.  
  176.      The standard deviation given is the actual standard
  177.      deviation of the sample, i.e. the root of the sum of the
  178.      squares of the difference between each value and the mean
  179.      divided by the number of items. The standard deviation of
  180.      the population is obtained by dividing the same sum of
  181.      squares by the number of items minus one. It is almost
  182.      always this latter figure which should be quoted as "the
  183.      standard deviation". It represents an attempt to estimate
  184.      what is the standard deviation of the measure in the
  185.      whole population from which the sample was drawn, and
  186.      seeks to correct for the effects of the limited sample
  187.      size. Equivalent remarks apply to the values quoted for
  188.      variance and population variance - generally the latter
  189.      should be used.
  190.  
  191.      Performing the BASICS command sets the values of the
  192.      special variables XMEAN, XTOTAL and XNUMBER, in addition
  193.      to the variables VV1, VV2, etc.
  194.  
  195.  
  196.  
  197.      
  198.        52 
  199.         Statistical commands  
  200.      
  201.      6:2. Chisq
  202.  
  203.      Format: C[hisq] [f] [n] [g[raphfile]] [cols rows]
  204.  
  205.      This command sets up a contingency table and performs a
  206.      chi-squared test on that table to determine the extent to
  207.      which the values in the table depart from those expected
  208.      if there is no tendency for categories to be associated
  209.      with each other.
  210.  
  211.      There are three options. An F will mean that provided a
  212.      two-by-two table is used Fisher's exact test will always
  213.      be performed, regardless of the values in the table.
  214.      EASISTAT automatically performs Fisher's exact test if
  215.      there is a total of less than 20 items in the table or if
  216.      the expected value for any cell is less than 5, but
  217.      specifying F will cause EASISTAT to perform Fisher's test
  218.      even if these conditions are not met. The N option means
  219.      that instead of composing the contingency table by
  220.      applying conditions to the data in EASISTAT's data table,
  221.      the user can enter by hand the values that he or she
  222.      wants to appear in each cell of the table. Using the
  223.      graphing option allows frequency histograms to be
  224.      displayed from the contingency table (see the relevant
  225.      section in the EASIGRAF documentation). Any, all, or none
  226.      of the options may be used at once.
  227.  
  228.      The user must supply the number of columns and rows for
  229.      the table. These can optionally be supplied on the
  230.      command line, otherwise EASISTAT will request them to be
  231.      entered. The user must also supply the conditions to be
  232.      used to categorise the values into these rows and
  233.      columns, or alternatively (when the N option is used)
  234.      must enter the numbers for each cell of the contingency
  235.      table.
  236.  
  237.      Example:
  238.  
  239.      Select command -  CHISQ
  240.  
  241.      - Chi-squared test -
  242.      Input number of columns:    2
  243.      Input number of rows:    2
  244.      Enter condition for column 1: C15<12
  245.      Enter condition for column 2: C15>=12
  246.      Enter condition for row A: SEX=1
  247.      Enter condition for row B: SEX=2
  248.  
  249.      Output:
  250.  
  251.      Column 1: C15<12
  252.      Column 2: C15>=12
  253.  
  254.      Row A: SEX=1
  255.      Row B: SEX=2
  256.  
  257.  
  258.              1                  2
  259.  
  260.       A  31.0 31.0% (32.12) 42.0 42.0% (40.88)      73.0  73.0%
  261.  
  262.  
  263.      
  264.        53 
  265.         Statistical commands  
  266.      
  267.       B  13.0 13.0% (11.88) 14.0 14.0% (15.12)      27.0  27.0%
  268.  
  269.           44.0 44.0%         56.0 56.0%              100.0
  270.  
  271.      Chi-squared = 0.258, 1 df   p = 0.6113
  272.  
  273.      Using Yates' correction: Chi-squared = 0.079, 1 df p = 0.7785
  274.  
  275.      In this example the first column consists of the number
  276.      of data rows for which C15 is less than 12, and the
  277.      second column the number of rows for which it is greater
  278.      than or equal to 12. (In the example data set in the file
  279.      EXAMPLE.DAT, C15 contains the GHQ scores.) The rows of
  280.      the contingency table contain a count of the number of
  281.      rows of the data table for which the value in the column
  282.      titled SEX (column 3 in the example data set) is equal to
  283.      1 or to 2. The contingency table output shows the
  284.      observed number of values falling into each category
  285.      followed by the observed percentage and then in brackets
  286.      by the expected number for each category. Since this
  287.      example was performed with 100 valid data rows, the
  288.      observed numbers and percentages are in fact equal. Row
  289.      and column totals and percentages are also output.
  290.  
  291.      Example:
  292.  
  293.      Select command -  c n f
  294.  
  295.      - Chi-squared test -
  296.      Input number of columns:   2
  297.      Input number of rows:   2
  298.      Enter 2 values for row A (all on one line): 13 7
  299.      Enter 2 values for row B (all on one line): 10 6
  300.  
  301.      Output:
  302.  
  303.              1                2
  304.  
  305.       A    13 (12.78) 36.1%  7 ( 7.22) 19.4%      20  55.6%
  306.  
  307.       B    10 (10.22) 27.8%  6 ( 5.78) 16.7%      16  44.4%
  308.  
  309.             23  63.9%        13  36.1%             36
  310.  
  311.      Chi-squared = 0.024, 1 df   p = 0.8767
  312.  
  313.      Using Yates' correction: Chi-squared = 0.038, 1 df p = 0.8462
  314.  
  315.      Fisher's exact test, p = 0.5752
  316.  
  317.      When the N option is used the values to go into the table
  318.      are entered directly by the user rather than being
  319.      counted from the data set. In the example above the user
  320.      enters the values 13, 7, 10 and 6 for a two-by-two table.
  321.      Since the F option was also specified, Fisher's exact
  322.      test is also performed.
  323.  
  324.      Example:
  325.  
  326.      Select command -  CH 2 3
  327.  
  328.  
  329.      
  330.        54 
  331.         Statistical commands  
  332.      
  333.      - Chi-squared test -
  334.      Enter condition for column 1:    SEX=1
  335.      Enter condition for column 2:    SEX=2
  336.      Enter condition for row A:    CLASS=1
  337.      Enter condition for row B:    CLASS=2
  338.      Enter condition for row C:    CLASS>2
  339.  
  340.      Output:
  341.  
  342.              1                  2
  343.  
  344.       A    41 (40.88) 41.0%   15 (15.12) 15.0%        56  56.0%
  345.  
  346.       B    24 (25.55) 24.0%   11 ( 9.45) 11.0%        35  35.0%
  347.  
  348.       C     8 ( 6.57)  8.0%    1 ( 2.43)  1.0%         9   9.0%
  349.  
  350.             73  73.0%          27  27.0%              100
  351.  
  352.      Chi-squared = 2.011, 2 df   p = 0.3659
  353.  
  354.      Using Yates' correction: Chi-squared = 0.537, 2 df p = 0.7644
  355.  
  356.      Comments
  357.  
  358.      The CHISQ command outputs the observed value in each
  359.      cell, the expected value in brackets, the column and row
  360.      totals and the percentages each figure represents with
  361.      respect to the total number of items. This means that the
  362.      command can be used simply to provide a frequency
  363.      distribution of the numbers and percentages of certain
  364.      observations falling within certain criteria, by setting
  365.      up a table with only one column. Here's how we can see
  366.      the numbers and percentages falling within different
  367.      ranges of GHQ score:
  368.  
  369.      Select command - c
  370.  
  371.      - Chi-squared test -
  372.      Input number of columns:   1
  373.      Input number of rows:   5
  374.      Enter condition for column 1:    1
  375.      Enter condition for row A:    GHQ<=25
  376.      Enter condition for row B:    GHQ>25&GHQ<=35
  377.      Enter condition for row C:    GHQ>35&GHQ<=45
  378.      Enter condition for row D:    GHQ>45&GHQ<=55
  379.      Enter condition for row E:    GHQ>55
  380.  
  381.      Output:
  382.  
  383.              1
  384.  
  385.       A    31 (31.00) 35.6%        31  35.6%
  386.  
  387.       B    35 (35.00) 40.2%        35  40.2%
  388.  
  389.       C    11 (11.00) 12.6%        11  12.6%
  390.  
  391.       D     7 ( 7.00)  8.0%         7   8.0%
  392.  
  393.  
  394.  
  395.      
  396.        55 
  397.         Statistical commands  
  398.      
  399.       E     3 ( 3.00)  3.4%         3   3.4%
  400.  
  401.             87  100.0%               87
  402.  
  403.      The expected values and row totals are still calculated,
  404.      though obviously they are the same as the observed
  405.      values. The use of just one column in this way can be
  406.      particularly useful when preparing graphs, especially of
  407.      continuous variables. A frequency histogram can be
  408.      generated using values gathered into a small number of
  409.      groups. If the G option had been specified with the above
  410.      example then a histogram with five bars would be
  411.      generated representing the five ranges.
  412.  
  413.  
  414.      6:3. Wilcoxon
  415.  
  416.      Format: W[ilcoxon] [s[igned]] [column]
  417.  
  418.      This command performs Wilcoxon's rank sum test to compare
  419.      the values in two groups to say whether the values are
  420.      generally higher in one group than those in the other. It
  421.      is exactly equivalent to two other commonly used
  422.      nonparametric tests, the Mann-Whitney U test and
  423.      Kendall's S, so only one of these tests is provided.
  424.  
  425.      Alternatively Wilcoxon's signed rank sum test can be
  426.      applied to test whether the values in a column are
  427.      generally greater than or less than 0. It would generally
  428.      be used to compare two columns in a pairwise manner.
  429.  
  430.      Example:
  431.  
  432.      Select command -  w c15
  433.      Enter condition for first group:   SEX=1
  434.      Enter condition for second group:   SEX=2
  435.  
  436.      Output:
  437.  
  438.      Wilcoxon's comparison of two groups:
  439.      Number (%)     Sum of ranks       Mean   Group
  440.           73  (73.0%)  T0  3804.0     3686.5     SEX=1
  441.           27  (27.0%)  T1  1246.0     1363.5     SEX=2
  442.      Variance:  16554.807     (Sum-mean)/sd:  0.913
  443.      One-tailed p = 0.1805
  444.  
  445.      The rank sum is taken as approximating to a normal
  446.      distribution with mean and standard deviation derived as
  447.      described by Armitage and Berry. The probability value
  448.      given is the one-tailed probability of the rank sum
  449.      reaching a value of such magnitude in the given direction
  450.      assuming this normal distribution. For low numbers in
  451.      each group the user may prefer to refer to a set of
  452.      tables quoting the exact probability value for the rank
  453.      sum dependent on the numbers in each group.
  454.  
  455.      If the SIGNED option (which can be abbreviated down to S)
  456.      is specified then Wilcoxon's signed rank sum test is used
  457.      to determine whether the values in a column are
  458.      significantly less than or greater than zero. The usual
  459.      application of this would be to first make one column the
  460.      difference between two others using the DERIVE command,
  461.      
  462.        56 
  463.         Statistical commands  
  464.      
  465.      and then to perform the signed rank test on it. This
  466.      would then be a pairwise test of whether the values in
  467.      one column were higher than those in the other.
  468.  
  469.      Example:
  470.  
  471.      Select command -  new c3 diff
  472.      Select command -  derive c3 c1-c2
  473.      Select command -  w s c3
  474.  
  475.      Output:
  476.  
  477.      Wilcoxon's signed rank sum test using C3 (DIFF)
  478.      n' = 25   T+ = 24.0   T- = 301.0
  479.      Variance = 1338.5
  480.      Standardised normal deviate with continuity correction = 3.772
  481.      One-tailed p = 0.0001
  482.  
  483.      Here the DERIVE command is first used to make the values
  484.      in c3 equal to the differences between the values in c1
  485.      and c2. Then the signed rank test is applied to c3 to
  486.      provide a pairwise test of whether the values in c1 are
  487.      signficantly higher or lower than in c2. A one-tailed
  488.      probability for the difference to assume such a magnitude
  489.      in the given direction is output.
  490.  
  491.  
  492.      6:4. Kendall's rank
  493.      correlation coefficient
  494.  
  495.      Format: K[endall] [column column]
  496.  
  497.      Investigates the relationship between two columns of
  498.      nonparametric data using Kendall's rank correlation
  499.      coefficient.
  500.  
  501.      Examples:
  502.  
  503.      Select command -  KEND GHQ HDA
  504.  
  505.      Select command -  k
  506.      Enter two columns to compare (one on each line):
  507.      c15
  508.      c16
  509.  
  510.      If the two columns are not included on the command line
  511.      EASISTAT will ask for them.
  512.  
  513.      Output:
  514.  
  515.      Rank correlation of C15 (GHQ) with C16 (HDA)
  516.      Kendall's S = P - Q = 3393 - 1164 = 2229
  517.      Kendall's tau (correlation coefficient) = 0.450
  518.      Variance of S = 111938.7, corrected normal deviate of S = 6.659
  519.      One-tailed p = 0.0000
  520.  
  521.      The correlation coefficient is sometimes referred to as
  522.      Kendall's tau. Kendall's S is taken as an approximating
  523.      to a normal distribution with mean and standard deviation
  524.      derived as described by Armitage and Berry. The
  525.      probability value given is the one-tailed probability of
  526.      Kendall's S of such magnitude assuming this normal
  527.      
  528.        57 
  529.         Statistical commands  
  530.      
  531.      distribution. It is the one-tailed probability that such
  532.      a correlation could have occurred in the direction found
  533.      by chance.
  534.  
  535.      Note: Some other statistics programs sometimes give a
  536.      slightly different value for the correlation coefficient.
  537.      This is because because they take into account ties (two
  538.      rows having the same value) before they calculate the
  539.      correlation coefficient. The procedure used by EASISTAT
  540.      (as recommended by Armitage and Berry) is to take into
  541.      account ties only when calculating the significance of
  542.      the correlation coefficient. Thus some other programs may
  543.      give different values for Kendall's tau, but the eventual
  544.      p value calculated should be the same (unless the other
  545.      program makes a mistake - at least one gives the wrong
  546.      answer).
  547.  
  548.  
  549.      6:5. Kolmogorov-Smirnov test
  550.  
  551.      Format: Ko[lmogorov] [g[raphfile]] [column]
  552.  
  553.      This compares a nonparametric measure between two groups
  554.      and tests whether the distribution of values between them
  555.      is significantly different.
  556.  
  557.      Examples:
  558.  
  559.      Select command -  ko g c15
  560.      Enter condition for first group:   c3=1
  561.      Enter condition for second group:   c3=2
  562.  
  563.      Select command -  ko
  564.      Enter column to test:  c15
  565.      Enter condition for first group:   c5<4
  566.      Enter condition for second group:   c5>=4
  567.  
  568.      If the column supplying the variable is not included in
  569.      the first line EASISTAT will ask for it.
  570.  
  571.      Output:
  572.  
  573.      Kolmogorov-Smirnov comparison of two groups using C15 (GHQ)
  574.      C5<4
  575.      C5>=4
  576.      K-S statistic = 0.4302
  577.      p = 0.0002
  578.  
  579.      Comments
  580.  
  581.      This test is not described in Armitage and Berry, but it
  582.      is sometimes used and it should not be hard to find a
  583.      reference to it in a statistics textbook (our
  584.      implementation is from Numerical Recipes in C by Press et
  585.      al). The function of this test is similar to Wilcoxon's
  586.      rank sum test, except that it does not test whether the
  587.      values in one group are in general higher or lower than
  588.      those in the other, but only whether the distributions
  589.      differ. It might therefore be possible to detect that two
  590.      distributions with equal medians are significantly
  591.      different because of differences in range, skewness or
  592.      kurtosis.
  593.      
  594.        58 
  595.         Statistical commands  
  596.      
  597.      What the test does is to compare the cumulative
  598.      percentage distributions of the two groups and to measure
  599.      the maximum separation between these two distributions (a
  600.      value between 0 and 1). The graphing option provides a
  601.      graphical representation of this and allows other
  602.      measures to be displayed as well, for example the
  603.      frequency distributions of the groups (see the relevant
  604.      section in the EASIGRAF documentation).
  605.  
  606.  
  607.      6:6. Ttest
  608.  
  609.      Format: Tt[est] [column]
  610.  
  611.      Format: Tt[est] [p[aired] [column column]]
  612.  
  613.      Student's t test is used to determine whether the values
  614.      in one group are significantly higher than those in
  615.      another group. If the option PAIRED (which may be
  616.      abbreviated down to P) follows the command then a paired
  617.      t test will be performed, otherwise an unpaired test. For
  618.      the unpaired test the values all lie in one column, and
  619.      two logical expressions must be entered to specify the
  620.      conditions which define the two groups. For the paired
  621.      test two columns are compared and the measures in each
  622.      row are taken to be paired.
  623.  
  624.      Example:
  625.  
  626.      Select command -  tt
  627.      Enter column to test:    GHQ
  628.      Enter condition for first group:  SEX=1
  629.      Enter condition for second group:  SEX=2
  630.  
  631.      Output:
  632.  
  633.      Studying C15 (GHQ)
  634.      Mean 18.84 if SEX=1
  635.      Mean 15.30 if SEX=2
  636.      Unpaired t test, 98 degrees of freedom: t = 0.927
  637.      Two-tailed p = 0.3560 (Assumes equal variances)
  638.      Comparison of means, standardised normal deviate: d = 0.977
  639.      Two-tailed p = 0.3283 (Does not assume equal variances)
  640.  
  641.      Two tests are performed. One assumes that although the
  642.      means may differ between the groups, the variances do
  643.      not. This compares the means of the groups according to a
  644.      t statistic and outputs a two-tailed probability value
  645.      for the difference between the two means to be as large
  646.      as it is by chance. The second test does not make the
  647.      assumption of equal variances. It takes the difference
  648.      between the means to approximate a normal distribution
  649.      and quotes the two-tailed probability for the difference
  650.      to be as large as it is.
  651.  
  652.      If the PAIRED option is selected then the values in two
  653.      columns are compared in a pairwise fashion, to see if the
  654.      mean difference between pairs is significantly less than
  655.      or greater than zero.
  656.  
  657.  
  658.  
  659.      
  660.        59 
  661.         Statistical commands  
  662.      
  663.      Example:
  664.  
  665.      Select command - TTEST P C16 C17
  666.  
  667.      Output:
  668.  
  669.      Comparing C16 (HDA) and C17 (HDD)
  670.      Paired t test, 99 degrees of freedom: t = 0.068
  671.      Two-tailed p = 0.9462
  672.  
  673.      Each row contains a pair of values, one in each of the
  674.      columns specified. The mean of the differences between
  675.      these values is taken to be a t statistic and the
  676.      probability value quoted is the two-tailed value for a
  677.      difference as large as this to occur by chance.
  678.  
  679.      If confidence limits have been requested (using the
  680.      LIMITS command) then upper and lower confidence limits
  681.      for the true mean difference between the groups or pairs
  682.      will also be output.
  683.  
  684.  
  685.      6:7. Linear regression and
  686.      correlation coefficient
  687.  
  688.      Format: R[egress] [g[raphfile]] [column column [column]]
  689.  
  690.      Calculates the correlation coefficient between two
  691.      measures in different columns, and calculates the linear
  692.      regression line ("least squares fit") for the second
  693.      column on the first.
  694.  
  695.      Examples:
  696.  
  697.      Select command -  REG C15 C16
  698.  
  699.      Select command -  r
  700.      Enter two columns to compare (one on each line):
  701.      c15
  702.      c16
  703.  
  704.      Output:
  705.  
  706.      Linear regression using C15 (GHQ) and C16 (HDA)
  707.      Regression of c16 on c15: C16 = 4.788 + 0.208 * C15
  708.      Correlation coefficient r = 0.725
  709.      SE(b)= 0.020 Significance: t = 10.416, 98 df p = 0.0000
  710.  
  711.      The correlation coefficient, r, is output (this is
  712.      sometimes referred to as Pearson's correlation
  713.      coefficient). The standard error of the gradient of the
  714.      line SE(b) is output, and this can be taken to be
  715.      distributed as a t statistic allowing the calculation of
  716.      confidence limits. It is also used to calculate the
  717.      significance of the results - the probability value
  718.      quoted is a two-tailed value for a correlation of such
  719.      magnitude to occur by chance.
  720.  
  721.      If confidence limits have been requested (using the
  722.      LIMITS command) then upper and lower confidence limits
  723.      for the true correlation coefficient and gradient will
  724.      also be output. The graphing option plots one variable
  725.      
  726.        60 
  727.         Statistical commands  
  728.      
  729.      against the other and allows the regression lines to be
  730.      displayed (see the relevant section in the EASIGRAF
  731.      documentation).
  732.  
  733.      If a third column name is given then it will be filled
  734.      with the values which would be predicted from the
  735.      regression equation with the coefficients arrived at.
  736.      These are the values which the dependent variable would
  737.      take if it was completely determined by the independent
  738.      variable according to the regression equation.
  739.  
  740.      Example:
  741.  
  742.      Select command -  REG C15 C16 C17
  743.  
  744.      This gives just the same as result as entering:
  745.  
  746.      Select command -  REG C15 C16 
  747.      Select command -  DERIVE C17 4.788 + 0.208 * C15
  748.  
  749.      The linear regression equation is automatically applied
  750.      to column 15 and the results entered into column 17.
  751.  
  752.  
  753.      6:8. Anova
  754.  
  755.      Format: A[nova] [N or g[raphfile]] [column]
  756.  
  757.      The one-way analysis of variance is equivalent to an
  758.      unpaired t test except that the comparison is performed
  759.      between more than two groups. It measures whether there
  760.      is a tendency for the groups of values to have different
  761.      means, or whether they might all be drawn from the same
  762.      population. The values lie in one column and the groups
  763.      are defined by conditions. If the option N (for
  764.      nonparametric) is chosen then the Kruskal-Wallis one-way
  765.      analysis of variance by ranks test is performed instead.
  766.  
  767.      Example:
  768.  
  769.      Select command - A
  770.  
  771.      - One-way analysis of variance -
  772.      Enter column for dependent variable
  773.      c15
  774.      Input number of groups:   5
  775.      Enter condition for group A:    c5=1
  776.      Enter condition for group B:    c5=2
  777.      Enter condition for group C:    c5=3
  778.      Enter condition for group D:    c5=4
  779.      Enter condition for group E:    c5=5
  780.  
  781.      Output:
  782.  
  783.       One-way analysis of variance with C15 (GHQ) as dependent variable
  784.       Group A:  C5=1
  785.       Group B:  C5=2
  786.       Group C:  C5=3
  787.       Group D:  C5>3
  788.  
  789.  
  790.  
  791.       
  792.         61 
  793.          Statistical commands  
  794.       
  795.       Between pairs of groups: t tests (96 df)
  796.                    A               B               C
  797.                 t      p        t      p        t      p
  798.       B  -1.111  0.2692
  799.       C  -0.400  0.6897   1.456  0.1487
  800.       D  -1.940  0.0553  -1.353  0.1793  -4.231  0.0001
  801.  
  802.       Overall significance: F = 6.463 3,96 df, p = 0.0005
  803.  
  804.      The analysis of variance outputs an F ratio which gives
  805.      the overall significance representing the probability
  806.      that all the group means could have varied so much by
  807.      chance. It also computes a t statistic and two-tailed
  808.      probability value for the difference between the means
  809.      for each pair of groups. This latter differs from
  810.      performing an ordinary unpaired t test between the two
  811.      groups only in that the whole sample is used to provide
  812.      an estimate of the overall variance of the measure,
  813.      rather than only relying on the values in the pair of
  814.      groups under consideration.
  815.  
  816.      The graphing option plots the values from each group in a
  817.      vertical scatter plot and allows the group means to be
  818.      displayed (see the relevant section in the EASIGRAF
  819.      documentation).
  820.  
  821.      Example:
  822.  
  823.      Select command - A N
  824.  
  825.      - One-way analysis of variance -
  826.      Enter column for dependent variable
  827.      c15
  828.      Input number of groups:   4
  829.      Enter condition for group A:    c5=1
  830.      Enter condition for group B:    c5=2
  831.      Enter condition for group C:    c5=3
  832.      Enter condition for group D:    c5>3
  833.  
  834.      Output:
  835.  
  836.       Kruskal-Wallis test with C15 (GHQ) as dependent variable
  837.       Group A:  Number = 3     Mean rank = 35.00        C5=1
  838.       Group B:  Number = 12    Mean rank = 52.88        C5=2
  839.       Group C:  Number = 41    Mean rank = 38.71        C5=3
  840.       Group D:  Number = 25    Mean rank = 59.66        C5=4
  841.       Group E:  Number = 19    Mean rank = 64.84        C5=5
  842.  
  843.       Between pairs of groups comparisons of mean ranks
  844.       (Two-tailed, corrected for multiple comparisons)
  845.                A              B              C              D
  846.           Ru-Rv     p    Ru-Rv     p    Ru-Rv     p    Ru-Rv     p
  847.       B   17.88    NS
  848.       C    3.71    NS   -14.17    NS
  849.       D   24.66    NS     6.78    NS    20.95  0.0887
  850.       E   29.84    NS    11.97    NS    26.13  0.0235   5.18    NS
  851.  
  852.       Overall significance: KW (corrected for ties) = 14.880,  4 df
  853.       p = 0.0050
  854.  
  855.      For the Kruskal-Wallis test the column and groups are
  856.      selected in the same way as for the parametric analysis
  857.      
  858.        62 
  859.         Statistical commands  
  860.      
  861.      of variance, and the output reports the overall
  862.      differences between the group ranks and between pairs of
  863.      groups comparisons as described in Nonparametric
  864.      Statistics for the Behavioural Sciences by Siegel.
  865.  
  866.  
  867.      6:9. Multiple regression
  868.  
  869.      Format: M[ultiple] [column [column]]
  870.  
  871.      This test measures how well one dependent variable (in
  872.      one column) is predicted by a number of independent
  873.      variables in other columns.
  874.  
  875.      Example:
  876.  
  877.      Select command - m
  878.  
  879.      - Multiple linear regression -
  880.      Enter column for dependent variable
  881.      c27
  882.      Input number of independent variables:   4
  883.      Input 4 columns (one on each line):
  884.      c18
  885.      c19
  886.      c20
  887.      c21
  888.  
  889.      Output:
  890.  
  891.      Multiple linear regression with C27 (SEV) as dependent
  892.      variable
  893.      Regression equation:
  894.      C27 =    0.146
  895.                +  0.093 * C19         SE(b) = 0.055
  896.                +  0.154 * C20         SE(b) = 0.075
  897.                +  0.029 * C21         SE(b) = 0.079
  898.                +  0.140 * C22         SE(b) = 0.065
  899.      Variance ratio F = (73.844/4)/0.717 = 25.747 df = 4,95
  900.      p = 0.0000
  901.  
  902.      Multiple correlation coefficient R = 0.721
  903.      Significance of each measure (95 degrees of freedom):
  904.      C19:  t = 1.694  p = 0.0935
  905.      C20:  t = 2.050  p = 0.0431
  906.      C21:  t = 0.370  p = 0.7122
  907.      C22:  t = 2.156  p = 0.0336
  908.  
  909.      This test outputs a multiple correlation coefficient and
  910.      the best-fitting linear regression equation using all the
  911.      independent variables. The coefficients for each variable
  912.      are given and their standard errors. These are used to
  913.      produce a t statistic and two-tailed significance for the
  914.      independent correlation of each variable with the
  915.      dependent variable. Note that this will vary according to
  916.      which other variables are included in the analysis. An
  917.      overall two-tailed probability derived from an F ratio of
  918.      variances is also given, representing the probability of
  919.      such a large multiple correlation coefficient occurring
  920.      by chance.
  921.  
  922.  
  923.      
  924.        63 
  925.         Statistical commands  
  926.      
  927.      If a second column name is given after the first, then it
  928.      will be filled with the values which would be predicted
  929.      from the regression equation with the coefficients
  930.      arrived at. These are the values which the dependent
  931.      variable would take if it was completely determined by
  932.      the independent variables according to the regression
  933.      equation.
  934.  
  935.      Example:
  936.  
  937.      Select command - m c27 c28
  938.  
  939.      Input number of independent variables:   4
  940.      Input 4 columns (one on each line):
  941.      c18
  942.      c19
  943.      c20
  944.      c21
  945.  
  946.      In this case column 28 will be filled with the predicted values.
  947.  
  948.  
  949.      6:10. Principal component analysis
  950.  
  951.      Format: Co[mponent] [g[raphfile]] [number of variables]
  952.  
  953.      Performs principal component analysis between a number of variables.
  954.  
  955.      Example:
  956.  
  957.      Select command - co
  958.  
  959.      - Principal component analysis -
  960.      Enter number of columns to analyse:  4
  961.      Input 4 columns (one on each line):
  962.      c19
  963.      c20
  964.      c21
  965.      c22
  966.      Input lower limit of contribution to variance to include
  967.      component into main table (0 for all, 1 for none):
  968.      0.05
  969.  
  970.      Output:
  971.  
  972.      Including largest 4 components into table
  973.      Principal component analysis
  974.      Contribution to overall variance:
  975.        Co1       Co2       Co3       Co4
  976.        0.7284    0.1586    0.0603    0.0528
  977.  
  978.      Correlations between components and variables:
  979.  
  980.                        Co1       Co2       Co3       Co4
  981.      C19  A         -0.6979    0.6932   -0.1751   -0.0421
  982.      C20  B         -0.9193   -0.0405    0.3085   -0.2409
  983.      C21  C         -0.9095   -0.0443    0.1250    0.3941
  984.      C22  D         -0.8617   -0.4021   -0.3001   -0.0758
  985.  
  986.      Principal components are derived (there is no facility to
  987.      rotate them). The contribution of each to the overall
  988.      variance is output, as is the correlation matrix between
  989.      
  990.        64 
  991.         Statistical commands  
  992.      
  993.      them and the original variables.
  994.  
  995.      All components contributing more than a certain fraction
  996.      of the overall variance are incorporated into the main
  997.      data table as new columns at the right-hand edge of the
  998.      table. They are titled Co1, Co2, etc. If the critical
  999.      fraction requested is 0 then all of the components will
  1000.      be so incorporated, if it is 1 then none of them will be.
  1001.  
  1002.      The orginal variables are not normalised before the
  1003.      analysis (i.e. they are not altered to have unit
  1004.      variance). The user may do this himself if he or she
  1005.      wishes, otherwise variables with a large variance will
  1006.      produce a proportionately large contribution to the
  1007.      analysis.
  1008.  
  1009.      The graphing option has nothing to do with principal
  1010.      components analysis and is just a way of selecting
  1011.      multiple columns to be output to a graph file so that
  1012.      they can subsequently be plotted against each other (see
  1013.      the relevant section in the EASIGRAF documentation).
  1014.  
  1015.  
  1016.      6:11. Minimise
  1017.  
  1018.      Format: Mi[nimise] [expression]
  1019.  
  1020.      This is a general purpose minimisation function which
  1021.      allows the performance, for example, of non-linear
  1022.      optimisations. To use it you enter an arithmetic
  1023.      expression which includes at least one of the general
  1024.      purpose variables (V1, V2, etc.) and then the names of
  1025.      those variables within the expression which are to be
  1026.      altered to minimise the value of the expression over all
  1027.      the data rows. Usually the aim will be to find the best
  1028.      fit of the expression to the values in one column and in
  1029.      this case the expression will automatically be converted
  1030.      into the expression for the least-squares fit to that
  1031.      column. If the original function is to be minimised
  1032.      instead, then enter NONE (which can be abbreviated down
  1033.      to N) instead of a column name.
  1034.  
  1035.      For example, to use the MINIMISE command to perform
  1036.      multiple linear regression with column HDD as the
  1037.      dependent variable and columns A, B, C, and D as
  1038.      independent variables:
  1039.  
  1040.      Select command -   min V1 + V2*A + V3*B + V4*C + V5*D
  1041.      Enter column to fit to or NONE to minimise function, and
  1042.      optional second column for best predicted fit:    HDD
  1043.      Enter list of variables to iterate (all on one line):
  1044.      V1 V2 V3 V4 V5
  1045.  
  1046.      Output:
  1047.  
  1048.      Sigma: ((V1+V2*A+V3*B+V4*C+V5*D) - HDD)POW2
  1049.         - function minimised after 9 iterations.
  1050.      Final value: 866.398
  1051.  
  1052.      v1            = 1.82441
  1053.      v2            = 0.346348
  1054.      v3            = 0.265328
  1055.      
  1056.        65 
  1057.         Statistical commands  
  1058.      
  1059.      v4            = 0.678139
  1060.      v5            = 0.24945
  1061.  
  1062.      The output will show you that the following function is
  1063.      in fact the one which is minimised:
  1064.  
  1065.      Sigma: ((V1 + V2*A + V3*B + V4*C + V5*D)-HDD)pow2
  1066.  
  1067.      This is the function for the least sum of squares
  1068.      difference between the supplied function and the column
  1069.      to fit to. The final value of this sum of squares is
  1070.      output, together with the best-fitting values for the
  1071.      variables which have been altered from their starting
  1072.      values. In this case the variables are the coefficients
  1073.      of the linear regression equation.
  1074.  
  1075.      General minimisation is slower, less accurate and less
  1076.      informative than the linear functions supplied (i.e. the
  1077.      simple and multiple linear regression commands), so it is
  1078.      best to try to convert your function to a linear form
  1079.      instead whenever possible (it often is). It is up to you
  1080.      to make sure that the function has a minimum, and to set
  1081.      appropriate starting values for the variables so that the
  1082.      global minimum is found if there is more than one local
  1083.      minimum.
  1084.  
  1085.      If no column is to be fitted to then the function itself
  1086.      is minimised, for example:
  1087.  
  1088.      Select command -   min 6*V1pow2+4*V1-123
  1089.      Enter column to fit to or NONE to minimise function, and
  1090.      optional second column for best predicted fit:    NONE
  1091.      Enter list of variables to iterate (all on one line):
  1092.      V1
  1093.  
  1094.      Sigma: 6*V1POW2+4*V1-123
  1095.        - function minimised after 1 iterations.
  1096.      Final value: -12366.7
  1097.  
  1098.      V1            = -0.33458
  1099.  
  1100.      This finds the value of V1 for which the supplied
  1101.      quadratic equation has a minimum, which in this case is
  1102.      -0.335. However note that even when the expression being
  1103.      minimised contains no column references, it is still
  1104.      evaluated once for every data row and the function value
  1105.      is the total over all the rows (this example was run with
  1106.      100 data rows, so the final value is 100 times what would
  1107.      be expected). This makes sense, because one might want to
  1108.      minimise a function such as 6*V1POW2+4*V1-C2, but it
  1109.      means that the minimisation will be unnecessarily slow if
  1110.      no values from the data table are actually needed. In
  1111.      such a case all the data rows can be temporarily excluded
  1112.      by issuing the command:
  1113.  
  1114.      Select command - NARROW 0
  1115.  
  1116.      The condition is always false so this makes all the data
  1117.      rows invalid. When there are no valid data rows the
  1118.      expression is calculated just once, rather than once for
  1119.      every data row.
  1120.  
  1121.      
  1122.        66 
  1123.         Statistical commands  
  1124.      
  1125.      If a second column name is given after the first, then it
  1126.      will be filled with the values which would be predicted
  1127.      from the function with the coefficients arrived at. These
  1128.      are the values which the dependent variable would take if
  1129.      the best-fitting function applied exactly.
  1130.  
  1131.      Here is a final example where column 3 is fitted to a
  1132.      non-linear function of columns 1 and 2. The results
  1133.      predicted from the function are then written into column
  1134.      4:
  1135.  
  1136.      Select command -   min V1*C1*exp(C2powV2)
  1137.      Enter column to fit to or NONE to minimise function, and
  1138.      optional second column for best predicted fit:  c3 c4
  1139.      Enter list of variables to iterate (all on one line):
  1140.      v1 v2
  1141.  
  1142.      Note
  1143.  
  1144.      The iterative process stops when one step fails to reduce
  1145.      the absolute value of the function by one ten thousandth.
  1146.      This should be appropriate for most applications,
  1147.      especially for least-squares fitting rather than general
  1148.      minimisation. This means that if the function has a value
  1149.      of 2 then the last step-size is less than 0.0002. However
  1150.      if the function (which may be the same shape) has a value
  1151.      of 200000 then the last step-size may be up to 20. If you
  1152.      want higher accuracy then you will have to add a constant
  1153.      to the function which reduces its absolute value to close
  1154.      to zero (in the latter example one would add -200000) and
  1155.      start the minimisation process again. Again, if the
  1156.      function is being evaluated over a number of data rows
  1157.      then the constant to add would need to be first divided
  1158.      by this number.
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.      
  1188.        67 
  1189.