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
60 activity="create program"
62 DATA LIST LIST /X * C *.
73 /STATISTICS=DESCRIPTIVES
76 if [ $? -ne 0 ] ; then no_result ; fi
79 activity="run program"
80 $SUPERVISOR $PSPP --testing-mode $TESTFILE
81 if [ $? -ne 0 ] ; then no_result ; fi
84 activity="compare results"
85 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
86 diff -b $TEMPDIR/pspp.list - << EOF
87 1.1 DATA LIST. Reading free-form data from INLINE.
94 2.1 EXAMINE. Case Processing Summary
95 #=#===============================#
97 # #----------+---------+----------#
98 # # Valid | Missing | Total #
99 # #--+-------+-+-------+--+-------#
100 # # N|Percent|N|Percent| N|Percent#
101 #=#==#=======#=#=======#==#=======#
102 #X#52| 100%|0| 0%|52| 100%#
103 #=#==#=======#=#=======#==#=======#
104 2.2 EXAMINE. Descriptives
105 #==============================================#=========#==========#
106 # #Statistic|Std. Error#
107 #==============================================#=========#==========#
108 #X Mean # 2.02 | .034 #
109 # 95% Confidence Interval for Mean Lower Bound# 1.952 | #
110 # Upper Bound# 2.087 | #
111 # 5% Trimmed Mean # 2.00 | #
113 # Variance # .058 | #
114 # Std. Deviation # .242 | #
115 # Minimum # 1.000 | #
116 # Maximum # 3.000 | #
118 # Interquartile Range # .00 | #
119 # Skewness # 1.194 | .330 #
120 # Kurtosis # 15.732 | .650 #
121 #==============================================#=========#==========#
123 if [ $? -ne 0 ] ; then fail ; fi