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
57 activity="create program"
59 DATA LIST LIST /X * C *.
70 /STATISTICS=DESCRIPTIVES
73 if [ $? -ne 0 ] ; then no_result ; fi
76 activity="run program"
77 $SUPERVISOR $PSPP -o raw-ascii $TESTFILE
78 if [ $? -ne 0 ] ; then no_result ; fi
81 activity="compare results"
82 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
83 diff -b $TEMPDIR/pspp.list - << EOF
84 1.1 DATA LIST. Reading free-form data from INLINE.
91 2.1 EXAMINE. Case Processing Summary
92 #=#===============================#
94 # #----------+---------+----------#
95 # # Valid | Missing | Total #
96 # #--+-------+-+-------+--+-------#
97 # # N|Percent|N|Percent| N|Percent#
98 #=#==#=======#=#=======#==#=======#
99 #X#52| 100%|0| 0%|52| 100%#
100 #=#==#=======#=#=======#==#=======#
101 2.2 EXAMINE. Descriptives
102 #============================================#=========#==========#
103 # #Statistic|Std. Error#
104 #============================================#=========#==========#
105 #XMean # 2.02 | .034 #
106 # 95% Confidence Interval for MeanLower Bound# 2.021 | #
107 # Upper Bound# 2.017 | #
108 # 5% Trimmed Mean # 2.00 | #
110 # Variance # .058 | #
111 # Std. Deviation # .242 | #
112 # Minimum # 1.000 | #
113 # Maximum # 3.000 | #
115 # Interquartile Range # .00 | #
116 # Skewness # 1.194 | .330 #
117 # Kurtosis # 15.732 | .650 #
118 #============================================#=========#==========#
120 if [ $? -ne 0 ] ; then fail ; fi