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 *.
84 /print = se coordinates
85 /criteria = testpos(large) distribution(free) ci(99)
89 /plot = curve(reference)
90 /print = se coordinates
91 /criteria = testpos(large) distribution(negexpo) ci(95)
94 if [ $? -ne 0 ] ; then no_result ; fi
96 activity="run program"
97 $SUPERVISOR $PSPP --testing-mode $TESTFILE
98 if [ $? -ne 0 ] ; then no_result ; fi
101 activity="compare results"
102 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
103 diff -b $TEMPDIR/pspp.list - << EOF
104 1.1 ROC. Case Summary
105 #========#===================#
106 # # Valid N (listwise)#
107 # #==========#========#
108 #a #Unweighted|Weighted#
109 #========#==========#========#
110 #Positive# 5| 50.000#
111 #Negative# 5| 50.000#
112 #========#==========#========#
113 1.2 ROC. Area Under the Curve (x)
114 #====#==========#===============#=======================#
115 # | | | Asymp. 99% Confidence #
116 # | | +-----------+-----------#
117 #Area|Std. Error|Asymptotic Sig.|Lower Bound|Upper Bound#
118 #====#==========#===============#===========#===========#
119 #.910| .030| .000| .839| .981#
120 #====#==========#===============#===========#===========#
121 1.3 ROC. Coordinates of the Curve (x)
122 #====================================#===========#===============#
123 #Positive if greater than or equal to|Sensitivity|1 - Specificity#
124 #====================================#===========#===============#
125 # .000| 1.000| 1.000#
131 #====================================#===========#===============#
132 2.1 ROC. Case Summary
133 #========#===================#
134 # # Valid N (listwise)#
135 # #==========#========#
136 #a #Unweighted|Weighted#
137 #========#==========#========#
138 #Positive# 5| 50.000#
139 #Negative# 5| 50.000#
140 #========#==========#========#
141 See pspp-1.png for a chart.
142 2.2 ROC. Area Under the Curve
143 #===================#====#==========#===============#=======================#
144 # # | | | Asymp. 95% #
145 # # | | +-----------+-----------#
146 #Variable under test#Area|Std. Error|Asymptotic Sig.|Lower Bound|Upper Bound#
147 #===================#====#==========#===============#===========#===========#
148 # x#.910| .030| .000| .860| .960#
149 # y#.697| .052| .001| .611| .783#
150 #===================#====#==========#===============#===========#===========#
151 2.3 ROC. Coordinates of the Curve
152 #=============#====================================#===========#===============#
153 #Test variable#Positive if greater than or equal to|Sensitivity|1 - Specificity#
154 #=============#====================================#===========#===============#
155 # x# .000| 1.000| 1.000#
156 # # 1.500| .960| .440#
157 # # 2.500| .880| .160#
158 # # 3.500| .680| .060#
159 # # 4.500| .400| .020#
160 # # 6.000| .000| .000#
161 #-------------#------------------------------------+-----------+---------------#
162 # y# .000| 1.000| 1.000#
163 # # 1.500| .960| .900#
164 # # 2.500| .680| .340#
165 # # 3.000| .600| .340#
166 # # 3.500| .600| .300#
167 # # 4.500| .200| .020#
168 # # 6.000| .000| .000#
169 #=============#====================================#===========#===============#
171 if [ $? -ne 0 ] ; then fail ; fi