3 # This program tests the ROC command.
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
8 # ensure that top_builddir are absolute
9 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
10 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
11 top_builddir=`cd $top_builddir; pwd`
12 PSPP=$top_builddir/src/ui/terminal/pspp
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
25 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
26 echo "NOT cleaning $TEMPDIR"
61 activity="create program"
64 data list notable list /x * y * w * a *.
82 /print = se coordinates
83 /criteria = testpos(large) distribution(free) ci(99)
87 /plot = curve(reference)
88 /print = se coordinates
89 /criteria = testpos(large) distribution(negexpo) ci(95)
92 if [ $? -ne 0 ] ; then no_result ; fi
94 activity="run program"
95 $SUPERVISOR $PSPP --testing-mode $TESTFILE
96 if [ $? -ne 0 ] ; then no_result ; fi
98 activity="compare results"
99 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
100 diff -b $TEMPDIR/pspp.list - << EOF
101 1.1 ROC. Case Summary
102 #========#===================#
103 # # Valid N (listwise)#
104 # #==========#========#
105 #a #Unweighted|Weighted#
106 #========#==========#========#
107 #Positive# 5| 50.000#
108 #Negative# 5| 50.000#
109 #========#==========#========#
110 1.2 ROC. Area Under the Curve (x)
111 #====#==========#===============#=======================#
112 # | | | Asymp. 99% Confidence #
113 # | | +-----------+-----------#
114 #Area|Std. Error|Asymptotic Sig.|Lower Bound|Upper Bound#
115 #====#==========#===============#===========#===========#
116 #.910| .030| .000| .839| .981#
117 #====#==========#===============#===========#===========#
118 1.3 ROC. Coordinates of the Curve (x)
119 #====================================#===========#===============#
120 #Positive if greater than or equal to|Sensitivity|1 - Specificity#
121 #====================================#===========#===============#
122 # .000| 1.000| 1.000#
128 #====================================#===========#===============#
129 2.1 ROC. Case Summary
130 #========#===================#
131 # # Valid N (listwise)#
132 # #==========#========#
133 #a #Unweighted|Weighted#
134 #========#==========#========#
135 #Positive# 5| 50.000#
136 #Negative# 5| 50.000#
137 #========#==========#========#
138 See pspp-1.png for a chart.
139 2.2 ROC. Area Under the Curve
140 #===================#====#==========#===============#=======================#
141 # # | | | Asymp. 95% #
142 # # | | +-----------+-----------#
143 #Variable under test#Area|Std. Error|Asymptotic Sig.|Lower Bound|Upper Bound#
144 #===================#====#==========#===============#===========#===========#
145 # x#.910| .030| .000| .860| .960#
146 # y#.697| .052| .001| .611| .783#
147 #===================#====#==========#===============#===========#===========#
148 2.3 ROC. Coordinates of the Curve
149 #=============#====================================#===========#===============#
150 #Test variable#Positive if greater than or equal to|Sensitivity|1 - Specificity#
151 #=============#====================================#===========#===============#
152 # x# .000| 1.000| 1.000#
153 # # 1.500| .960| .440#
154 # # 2.500| .880| .160#
155 # # 3.500| .680| .060#
156 # # 4.500| .400| .020#
157 # # 6.000| .000| .000#
158 #-------------#------------------------------------+-----------+---------------#
159 # y# .000| 1.000| 1.000#
160 # # 1.500| .960| .900#
161 # # 2.500| .680| .340#
162 # # 3.000| .600| .300#
163 # # 3.500| .600| .300#
164 # # 4.500| .200| .020#
165 # # 6.000| .000| .000#
166 #=============#====================================#===========#===============#
168 if [ $? -ne 0 ] ; then fail ; fi