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`
14 # ensure that top_srcdir is absolute
15 top_srcdir=`cd $top_srcdir; pwd`
17 STAT_CONFIG_PATH=$top_srcdir/config
18 export STAT_CONFIG_PATH
56 activity="create program"
58 DATA LIST LIST /X * C *.
69 /STATISTICS=DESCRIPTIVES
72 if [ $? -ne 0 ] ; then no_result ; fi
75 activity="run program"
76 $SUPERVISOR $top_builddir/src/pspp -o raw-ascii $TESTFILE
77 if [ $? -ne 0 ] ; then no_result ; fi
80 activity="compare results"
81 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
82 diff -b $TEMPDIR/pspp.list - << EOF
83 1.1 DATA LIST. Reading free-form data from INLINE.
90 2.1 EXAMINE. Case Processing Summary
91 #=#===============================#
93 # #----------+---------+----------#
94 # # Valid | Missing | Total #
95 # #--+-------+-+-------+--+-------#
96 # # N|Percent|N|Percent| N|Percent#
97 #=#==#=======#=#=======#==#=======#
98 #X#52| 100%|0| 0%|52| 100%#
99 #=#==#=======#=#=======#==#=======#
100 2.2 EXAMINE. Descriptives
101 #============================================#=========#==========#
102 # #Statistic|Std. Error#
103 #============================================#=========#==========#
104 #XMean # 2.02 | .034 #
105 # 95% Confidence Interval for MeanLower Bound# 2.021 | #
106 # Upper Bound# 2.017 | #
107 # 5% Trimmed Mean # 2.00 | #
109 # Variance # .058 | #
110 # Std. Deviation # .242 | #
111 # Minimum # 1.000 | #
112 # Maximum # 3.000 | #
114 # Interquartile Range # .00 | #
115 # Skewness # 1.194 | .330 #
116 # Kurtosis # 15.732 | .650 #
117 #============================================#=========#==========#
119 if [ $? -ne 0 ] ; then fail ; fi