Fix missing @clicksequence problem with older Texinfo versions.
[pspp-builds.git] / tests / command / oneway-with-splits.sh
1 #!/bin/sh
2
3 # This program tests that the ONEWAY anova command works OK
4 # when SPLIT FILE is active
5
6 TEMPDIR=/tmp/pspp-tst-$$
7 TESTFILE=$TEMPDIR/`basename $0`.sps
8
9 # ensure that top_builddir  are absolute
10 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
11 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
12 top_builddir=`cd $top_builddir; pwd`
13 PSPP=$top_builddir/src/ui/terminal/pspp
14
15 # ensure that top_srcdir is absolute
16 top_srcdir=`cd $top_srcdir; pwd`
17
18 STAT_CONFIG_PATH=$top_srcdir/config
19 export STAT_CONFIG_PATH
20
21
22 cleanup()
23 {
24     if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then 
25         echo Not cleaning $TEMPDIR;
26         return ; 
27     fi
28     cd /
29     rm -rf $TEMPDIR
30 }
31
32
33 fail()
34 {
35     echo $activity
36     echo FAILED
37     cleanup;
38     exit 1;
39 }
40
41
42 no_result()
43 {
44     echo $activity
45     echo NO RESULT;
46     cleanup;
47     exit 2;
48 }
49
50 pass()
51 {
52     cleanup;
53     exit 0;
54 }
55
56 mkdir -p $TEMPDIR
57
58 cd $TEMPDIR
59
60 activity="create program"
61 cat > $TESTFILE <<EOF
62 DATA LIST LIST /QUALITY * BRAND * S *.
63 BEGIN DATA
64 3 1 1
65 2 1 1
66 1 1 1
67 1 1 1
68 4 1 1
69 5 2 1
70 2 2 1
71 4 2 2
72 2 2 2
73 3 2 2
74 7  3 2
75 4  3 2
76 5  3 2
77 3  3 2
78 6  3 2
79 END DATA
80
81 VARIABLE LABELS brand 'Manufacturer'.
82 VARIABLE LABELS quality 'Breaking Strain'.
83
84 VALUE LABELS /brand 1 'Aspeger' 2 'Bloggs' 3 'Charlies'.
85
86 SPLIT FILE by s.
87
88 ONEWAY
89         quality BY brand
90         /STATISTICS descriptives homogeneity
91         /CONTRAST =  -2 2
92         /CONTRAST = -1 1
93         .
94 EOF
95 if [ $? -ne 0 ] ; then no_result ; fi
96
97
98 activity="run program"
99 $SUPERVISOR $PSPP --testing-mode $TESTFILE
100 if [ $? -ne 0 ] ; then no_result ; fi
101
102 perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
103 diff -b  $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
104 1.1 DATA LIST.  Reading free-form data from INLINE.
105 +--------+------+
106 |Variable|Format|
107 #========#======#
108 |QUALITY |F8.0  |
109 |BRAND   |F8.0  |
110 |S       |F8.0  |
111 +--------+------+
112
113 Variable Value    Label
114 S            1.00
115
116 2.1 ONEWAY.  Descriptives
117 #===============#=======#=#====#==============#==========#=======================#=======#=======#
118 #               |       # |    |              |          |    95% Confidence     |       |       #
119 #               |       # |    |              |          +-----------+-----------+       |       #
120 #               |       #N|Mean|Std. Deviation|Std. Error|Lower Bound|Upper Bound|Minimum|Maximum#
121 #===============#=======#=#====#==============#==========#===========#===========#=======#=======#
122 #Breaking Strain|Aspeger#5|2.20|          1.30|       .58|        .58|       3.82|   1.00|   4.00#
123 #               |Bloggs #2|3.50|          2.12|      1.50|     -15.56|      22.56|   2.00|   5.00#
124 #               |Total  #7|2.57|          1.51|       .57|       1.17|       3.97|   1.00|   5.00#
125 #===============#=======#=#====#==============#==========#===========#===========#=======#=======#
126
127 2.2 ONEWAY.  Test of Homogeneity of Variances
128 #===============#================#===#===#============#
129 #               #Levene Statistic|df1|df2|Significance#
130 #===============#================#===#===#============#
131 #Breaking Strain#           1.086|  1|  5|        .345#
132 #===============#================#===#===#============#
133
134 2.3 ONEWAY.  ANOVA
135 #==============================#==============#==#===========#=====#============#
136 #                              #Sum of Squares|df|Mean Square|  F  |Significance#
137 #===============#==============#==============#==#===========#=====#============#
138 #Breaking Strain|Between Groups#          2.41| 1|      2.414|1.068|        .349#
139 #               |Within Groups #         11.30| 5|      2.260|     |            #
140 #               |Total         #         13.71| 6|           |     |            #
141 #===============#==============#==============#==#===========#=====#============#
142
143 2.4 ONEWAY.  Contrast Coefficients
144 #==========#==============#
145 #          # Manufacturer #
146 #          #-------+------#
147 #          #Aspeger|Bloggs#
148 #========#=#=======#======#
149 #Contrast|1#     -2|     2#
150 #        |2#     -1|     1#
151 #========#=#=======#======#
152
153 2.5 ONEWAY.  Contrast Tests
154 #===============================================#=================#==========#=====#=====#===============#
155 #                                       Contrast#Value of Contrast|Std. Error|  t  |  df |Sig. (2-tailed)#
156 #===============#======================#========#=================#==========#=====#=====#===============#
157 #Breaking Strain|Assume equal variances|    1   #             2.60|     2.516|1.034|    5|           .349#
158 #               |                      |    2   #             1.30|     1.258|1.034|    5|           .349#
159 #               |Does not assume equal |    1   #             2.60|     3.219| .808|1.318|           .539#
160 #               |                      |    2   #             1.30|     1.609| .808|1.318|           .539#
161 #===============#======================#========#=================#==========#=====#=====#===============#
162
163 Variable Value    Label
164 S            2.00
165
166 2.6 ONEWAY.  Descriptives
167 #===============#========#=#====#==============#==========#=======================#=======#=======#
168 #               |        # |    |              |          |    95% Confidence     |       |       #
169 #               |        # |    |              |          +-----------+-----------+       |       #
170 #               |        #N|Mean|Std. Deviation|Std. Error|Lower Bound|Upper Bound|Minimum|Maximum#
171 #===============#========#=#====#==============#==========#===========#===========#=======#=======#
172 #Breaking Strain|Bloggs  #3|3.00|          1.00|       .58|        .52|       5.48|   2.00|   4.00#
173 #               |Charlies#5|5.00|          1.58|       .71|       3.04|       6.96|   3.00|   7.00#
174 #               |Total   #8|4.25|          1.67|       .59|       2.85|       5.65|   2.00|   7.00#
175 #===============#========#=#====#==============#==========#===========#===========#=======#=======#
176
177 2.7 ONEWAY.  Test of Homogeneity of Variances
178 #===============#================#===#===#============#
179 #               #Levene Statistic|df1|df2|Significance#
180 #===============#================#===#===#============#
181 #Breaking Strain#            .923|  1|  6|        .374#
182 #===============#================#===#===#============#
183
184 2.8 ONEWAY.  ANOVA
185 #==============================#==============#==#===========#=====#============#
186 #                              #Sum of Squares|df|Mean Square|  F  |Significance#
187 #===============#==============#==============#==#===========#=====#============#
188 #Breaking Strain|Between Groups#          7.50| 1|      7.500|3.750|        .101#
189 #               |Within Groups #         12.00| 6|      2.000|     |            #
190 #               |Total         #         19.50| 7|           |     |            #
191 #===============#==============#==============#==#===========#=====#============#
192
193 2.9 ONEWAY.  Contrast Coefficients
194 #==========#===============#
195 #          #  Manufacturer #
196 #          #------+--------#
197 #          #Bloggs|Charlies#
198 #========#=#======#========#
199 #Contrast|1#    -2|       2#
200 #        |2#    -1|       1#
201 #========#=#======#========#
202
203 2.10 ONEWAY.  Contrast Tests
204 #===============================================#=================#==========#=====#=====#===============#
205 #                                       Contrast#Value of Contrast|Std. Error|  t  |  df |Sig. (2-tailed)#
206 #===============#======================#========#=================#==========#=====#=====#===============#
207 #Breaking Strain|Assume equal variances|    1   #             4.00|     2.066|1.936|    6|           .101#
208 #               |                      |    2   #             2.00|     1.033|1.936|    6|           .101#
209 #               |Does not assume equal |    1   #             4.00|     1.826|2.191|5.882|           .072#
210 #               |                      |    2   #             2.00|      .913|2.191|5.882|           .072#
211 #===============#======================#========#=================#==========#=====#=====#===============#
212
213 EOF
214 if [ $? -ne 0 ] ; then fail ; fi
215
216 pass