3 # This program tests the Trimmed Mean calculation, in the case
4 # where the data is weighted towards the centre
6 TEMPDIR=/tmp/pspp-tst-$$
7 TESTFILE=$TEMPDIR/`basename $0`.sps
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
15 # ensure that top_srcdir is absolute
16 top_srcdir=`cd $top_srcdir; pwd`
18 STAT_CONFIG_PATH=$top_srcdir/config
19 export STAT_CONFIG_PATH
27 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
28 echo "NOT cleaning $TEMPDIR"
64 activity="create program"
66 DATA LIST LIST /X * C *.
77 /STATISTICS=DESCRIPTIVES
80 if [ $? -ne 0 ] ; then no_result ; fi
83 activity="run program"
84 $SUPERVISOR $PSPP --testing-mode $TESTFILE
85 if [ $? -ne 0 ] ; then no_result ; fi
88 activity="compare results"
89 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
90 diff -b $TEMPDIR/pspp.list - << EOF
91 1.1 DATA LIST. Reading free-form data from INLINE.
98 2.1 EXAMINE. Case Processing Summary
99 #=#===============================#
101 # #----------+---------+----------#
102 # # Valid | Missing | Total #
103 # #--+-------+-+-------+--+-------#
104 # # N|Percent|N|Percent| N|Percent#
105 #=#==#=======#=#=======#==#=======#
106 #X#52| 100%|0| 0%|52| 100%#
107 #=#==#=======#=#=======#==#=======#
108 2.2 EXAMINE. Descriptives
109 #==============================================#=========#==========#
110 # #Statistic|Std. Error#
111 #==============================================#=========#==========#
112 #X Mean # 2.02 | .034 #
113 # 95% Confidence Interval for Mean Lower Bound# 1.952 | #
114 # Upper Bound# 2.087 | #
115 # 5% Trimmed Mean # 2.00 | #
117 # Variance # .058 | #
118 # Std. Deviation # .242 | #
119 # Minimum # 1.000 | #
120 # Maximum # 3.000 | #
122 # Interquartile Range # .00 | #
123 # Skewness # 1.194 | .330 #
124 # Kurtosis # 15.732 | .650 #
125 #==============================================#=========#==========#
127 if [ $? -ne 0 ] ; then fail ; fi