X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fstats%2Fexamine.at;h=bea69dd354d06303f7a71c2f25cbf0f001bb4580;hb=9d24b4fb4d831d7a2bebb51fd111726f0e682e45;hp=54307f4688732abb85c445ae6deb8498d6e254f1;hpb=fb38178d67da062cf6bbbce5ad560aeca8e259c3;p=pspp diff --git a/tests/language/stats/examine.at b/tests/language/stats/examine.at index 54307f4688..bea69dd354 100644 --- a/tests/language/stats/examine.at +++ b/tests/language/stats/examine.at @@ -1,6 +1,23 @@ +dnl PSPP - a program for statistical analysis. +dnl Copyright (C) 2017, 2019 Free Software Foundation, Inc. +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see . +dnl AT_BANNER([EXAMINE]) AT_SETUP([EXAMINE]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine.sps], [ DATA LIST LIST /QUALITY * W * BRAND * . BEGIN DATA @@ -70,7 +87,7 @@ Table: Case Processing Summary ,Cases,,,,, ,Valid,,Missing,,Total, ,N,Percent,N,Percent,N,Percent -Breaking Strain,24.00,100%,.00,0%,24.00,100% +Breaking Strain,24.00,100.0%,.00,.0%,24.00,100.0% Table: Extreme Values ,,,Case Number,Value @@ -98,12 +115,12 @@ Breaking Strain,Mean,,3.54,.32 ,Kurtosis,,-.36,.92 Table: Case Processing Summary -,,Cases,,,,, +,Manufacturer,Cases,,,,, ,,Valid,,Missing,,Total, -,Manufacturer,N,Percent,N,Percent,N,Percent -Breaking Strain,Aspeger,8.00,100%,.00,0%,8.00,100% -,Bloggs,8.00,100%,.00,0%,8.00,100% -,Charlies,8.00,100%,.00,0%,8.00,100% +,,N,Percent,N,Percent,N,Percent +Breaking Strain,Aspeger,8.00,100.0%,.00,.0%,8.00,100.0% +,Bloggs,8.00,100.0%,.00,.0%,8.00,100.0% +,Charlies,8.00,100.0%,.00,.0%,8.00,100.0% Table: Extreme Values ,Manufacturer,,,Case Number,Value @@ -172,6 +189,7 @@ Breaking Strain,Aspeger,Mean,,2.25,.45 AT_CLEANUP AT_SETUP([EXAMINE -- extremes]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine.sps], [dnl data list free /V1 W begin data. @@ -200,7 +218,7 @@ end data. weight by w. -examine v1 +examine v1 /statistics=extreme(6) . ]) @@ -210,7 +228,7 @@ Table: Case Processing Summary ,Cases,,,,, ,Valid,,Missing,,Total, ,N,Percent,N,Percent,N,Percent -V1,23.00,100%,.00,0%,23.00,100% +V1,23.00,100.0%,.00,.0%,23.00,100.0% Table: Extreme Values ,,,Case Number,Value @@ -231,8 +249,8 @@ V1,Highest,1,21,20.00 AT_CLEANUP - AT_SETUP([EXAMINE -- extremes with fractional weights]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([extreme.sps], [dnl set format=F20.3. data list notable list /w * x *. @@ -271,7 +289,7 @@ Table: Case Processing Summary ,Cases,,,,, ,Valid,,Missing,,Total, ,N,Percent,N,Percent,N,Percent -x,19.430,100%,.000,0%,19.430,100% +x,19.430,100.0%,.000,.0%,19.430,100.0% Table: Extreme Values ,,,Case Number,Value @@ -306,15 +324,16 @@ x,Mean,,1120010.293,86222.178 AT_CLEANUP dnl Test the PERCENTILES subcommand of the EXAMINE command. -dnl In particular test that it behaves properly when there are only +dnl In particular test that it behaves properly when there are only dnl a few cases. AT_SETUP([EXAMINE -- percentiles]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine.sps], [dnl DATA LIST LIST /X *. BEGIN DATA. -2.00 -8.00 -5.00 +2.00 +8.00 +5.00 END DATA. EXAMINE /x @@ -332,7 +351,7 @@ EXAMINE /x EXAMINE /x /PERCENTILES=AEMPIRICAL. ]) -AT_CHECK([pspp -o pspp.csv examine.sps]) +AT_CHECK([pspp -o pspp.csv -o pspp.txt examine.sps]) AT_CHECK([cat pspp.csv], [0], [dnl Table: Reading free-form data from INLINE. Variable,Format @@ -342,19 +361,19 @@ Table: Case Processing Summary ,Cases,,,,, ,Valid,,Missing,,Total, ,N,Percent,N,Percent,N,Percent -X,3,100%,0,0%,3,100% +X,3,100.0%,0,.0%,3,100.0% Table: Percentiles ,,Percentiles,,,,,, ,,5,10,25,50,75,90,95 -X,HAverage,.40,.80,2.00,5.00,8.00,8.00,8.00 +X,Weighted Average,.40,.80,2.00,5.00,8.00,8.00,8.00 ,Tukey's Hinges,,,3.50,5.00,6.50,, Table: Case Processing Summary ,Cases,,,,, ,Valid,,Missing,,Total, ,N,Percent,N,Percent,N,Percent -X,3,100%,0,0%,3,100% +X,3,100.0%,0,.0%,3,100.0% Table: Percentiles ,,Percentiles,,,,,, @@ -366,45 +385,46 @@ Table: Case Processing Summary ,Cases,,,,, ,Valid,,Missing,,Total, ,N,Percent,N,Percent,N,Percent -X,3,100%,0,0%,3,100% +X,3,100.0%,0,.0%,3,100.0% Table: Percentiles ,,Percentiles,,,,,, ,,5,10,25,50,75,90,95 -X,Rounded,.00,.00,2.00,5.00,5.00,8.00,8.00 +X,Weighted Average,.00,.00,2.00,5.00,5.00,8.00,8.00 ,Tukey's Hinges,,,3.50,5.00,6.50,, Table: Case Processing Summary ,Cases,,,,, ,Valid,,Missing,,Total, ,N,Percent,N,Percent,N,Percent -X,3,100%,0,0%,3,100% +X,3,100.0%,0,.0%,3,100.0% Table: Percentiles ,,Percentiles,,,,,, ,,5,10,25,50,75,90,95 -X,Empirical,2.00,2.00,2.00,5.00,8.00,8.00,8.00 +X,Weighted Average,2.00,2.00,2.00,5.00,8.00,8.00,8.00 ,Tukey's Hinges,,,3.50,5.00,6.50,, Table: Case Processing Summary ,Cases,,,,, ,Valid,,Missing,,Total, ,N,Percent,N,Percent,N,Percent -X,3,100%,0,0%,3,100% +X,3,100.0%,0,.0%,3,100.0% Table: Percentiles ,,Percentiles,,,,,, ,,5,10,25,50,75,90,95 -X,Empirical with averaging,2.00,2.00,2.00,5.00,8.00,8.00,8.00 +X,Weighted Average,2.00,2.00,2.00,5.00,8.00,8.00,8.00 ,Tukey's Hinges,,,3.50,5.00,6.50,, ]) AT_CLEANUP AT_SETUP([EXAMINE -- missing values]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine.sps], [dnl DATA LIST LIST /x * y *. BEGIN DATA. -1 1 +1 1 2 1 3 1 4 1 @@ -428,19 +448,20 @@ Table: Case Processing Summary ,Cases,,,,, ,Valid,,Missing,,Total, ,N,Percent,N,Percent,N,Percent -x,6,85.7143%,1,14.2857%,7,100% +x,6,85.7%,1,14.3%,7,100.0% Table: Case Processing Summary -,,Cases,,,,, +,y,Cases,,,,, ,,Valid,,Missing,,Total, -,y,N,Percent,N,Percent,N,Percent -x,1.00,4,100%,0,0%,4,100% -,2.00,2,66.6667%,1,33.3333%,3,100% +,,N,Percent,N,Percent,N,Percent +x,1.00,4,100.0%,0,.0%,4,100.0% +,2.00,2,66.7%,1,33.3%,3,100.0% ]) AT_CLEANUP AT_SETUP([EXAMINE -- user missing values]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine-m.sps], [dnl DATA LIST notable LIST /x * y *. BEGIN DATA. @@ -461,12 +482,13 @@ Table: Case Processing Summary ,Cases,,,,, ,Valid,,Missing,,Total, ,N,Percent,N,Percent,N,Percent -x,1,33.3333%,2,66.6667%,3,100% -y,2,66.6667%,1,33.3333%,3,100% +x,1,33.3%,2,66.7%,3,100.0% +y,2,66.7%,1,33.3%,3,100.0% ]) AT_CLEANUP AT_SETUP([EXAMINE -- missing values and percentiles]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine.sps], [dnl DATA LIST LIST /X *. BEGIN DATA. @@ -487,6 +509,7 @@ AT_CLEANUP dnl Tests the trimmed mean calculation in the case dnl where the data is weighted towards the centre. AT_SETUP([EXAMINE -- trimmed mean]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine.sps], [dnl DATA LIST LIST /X * C *. BEGIN DATA. @@ -513,7 +536,7 @@ Table: Case Processing Summary ,Cases,,,,, ,Valid,,Missing,,Total, ,N,Percent,N,Percent,N,Percent -X,52.00,100%,.00,0%,52.00,100% +X,52.00,100.0%,.00,.0%,52.00,100.0% Table: Descriptives ,,,Statistic,Std. Error @@ -534,6 +557,7 @@ X,Mean,,2.02,.03 AT_CLEANUP AT_SETUP([EXAMINE -- crash bug]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine.sps], [dnl data list list /a * x * y *. begin data. @@ -544,7 +568,7 @@ end data. examine a by x by y /statistics=DESCRIPTIVES - . + . ]) AT_CHECK([pspp -o pspp.csv examine.sps]) dnl Ignore output -- this is just a no-crash check. @@ -552,6 +576,7 @@ AT_CLEANUP dnl Test that two consecutive EXAMINE commands don't crash PSPP. AT_SETUP([EXAMINE -- consecutive runs don't crash]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine.sps], [dnl data list list /y * z *. begin data. @@ -562,7 +587,7 @@ end data. EXAMINE /VARIABLES= z BY y. -EXAMINE /VARIABLES= z. +EXAMINE /VARIABLES= z. ]) AT_CHECK([pspp -o pspp.csv examine.sps]) dnl Ignore output -- this is just a no-crash check. @@ -570,6 +595,7 @@ AT_CLEANUP dnl Test that /DESCRIPTIVES does not crash in presence of missing values. AT_SETUP([EXAMINE -- missing values don't crash]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine.sps], [dnl data list list /x * y *. begin data. @@ -579,7 +605,7 @@ begin data. 3 1 4 1 end data. -examine x by y /statistics=descriptives. +examine x by y /statistics=descriptives. ]) AT_CHECK([pspp -o pspp.csv examine.sps]) dnl Ignore output -- this is just a no-crash check. @@ -587,16 +613,17 @@ AT_CLEANUP dnl Test that having only a single case doesn't crash. AT_SETUP([EXAMINE -- single case doesn't crash]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine.sps], [dnl DATA LIST LIST /quality * . BEGIN DATA -3 +3 END DATA EXAMINE - quality - /STATISTICS descriptives + quality + /STATISTICS descriptives /PLOT = histogram . ]) @@ -606,6 +633,7 @@ AT_CLEANUP dnl Test that all-missing data doesn't crash. AT_SETUP([EXAMINE -- all-missing data doesn't crash]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine.sps], [dnl DATA LIST LIST /x *. BEGIN DATA. @@ -615,7 +643,12 @@ BEGIN DATA. . END DATA. -EXAMINE /x PLOT=HISTOGRAM. +EXAMINE /x + PLOT=HISTOGRAM BOXPLOT NPPLOT SPREADLEVEL(1) ALL + /ID=x + /STATISTICS = DESCRIPTIVES EXTREME (5) ALL + /PERCENTILE=AEMPIRICAL + . ]) AT_CHECK([pspp -o pspp.csv examine.sps], [0], [ignore]) dnl Ignore output -- this is just a no-crash check. @@ -623,6 +656,7 @@ AT_CLEANUP dnl Test that big input doesn't crash (bug 11307). AT_SETUP([EXAMINE -- big input doesn't crash]) +AT_KEYWORDS([categorical categoricals slow]) AT_DATA([examine.sps], [dnl INPUT PROGRAM. LOOP #I=1 TO 50000. @@ -643,11 +677,11 @@ AT_CLEANUP dnl Another test that big input doesn't crash. dnl The actual bug that this checks for has been lost. AT_SETUP([EXAMINE -- big input doesn't crash 2]) -AT_DATA([make-big-input.pl], - [for ($i=0; $i<100000; $i++) { print "AB12\n" }; - for ($i=0; $i<100000; $i++) { print "AB04\n" }; -]) -AT_CHECK([$PERL make-big-input.pl > large.txt]) +AT_KEYWORDS([categorical categoricals slow]) +AT_CHECK([$PYTHON3 -c ' +for i in range(100000): print("AB12") +for i in range(100000): print("AB04") +' > large.txt]) AT_DATA([examine.sps], [dnl DATA LIST FILE='large.txt' /S 1-2 (A) X 3 . @@ -659,10 +693,7 @@ EXAMINE /A BY X. ]) AT_CHECK([pspp -o pspp.csv examine.sps]) dnl Ignore output -- this is just a no-crash check. -AT_DATA([more-big-input.pl], - [for ($i=0; $i<25000; $i++) { print "AB04\nAB12\n" }; -]) -AT_CHECK([$PERL more-big-input.pl >> large.txt]) +AT_CHECK([$PYTHON3 -c 'for i in range(25000): print("AB04\nAB12")' >> large.txt]) AT_CHECK([pspp -o pspp.csv examine.sps]) dnl Ignore output -- this is just a no-crash check. AT_CLEANUP @@ -670,6 +701,7 @@ AT_CLEANUP dnl Test that the ID command works with non-numberic variables AT_SETUP([EXAMINE -- non-numeric ID]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine-id.sps], [dnl data list notable list /x * y (a12). @@ -690,6 +722,7 @@ begin data. 300 threehundred end data. +set small=0. examine x /statistics = extreme /id = y @@ -697,31 +730,37 @@ examine x . ]) -AT_CHECK([pspp -O format=csv examine-id.sps], [0], -[Table: Case Processing Summary +AT_CHECK([pspp -O format=csv examine-id.sps], [0], [dnl +Table: Case Processing Summary ,Cases,,,,, ,Valid,,Missing,,Total, ,N,Percent,N,Percent,N,Percent -x,14,100%,0,0%,14,100% +x,14,100.0%,0,.0%,14,100.0% Table: Extreme Values ,,,y,Value x,Highest,1,threehundred,300.00 -,,2,thirty ,30.00 -,,3,twelve ,12.00 -,,4,eleven ,11.00 -,,5,ten ,10.00 -,Lowest,1,one ,1.00 -,,2,two ,2.00 -,,3,three ,3.00 -,,4,four ,4.00 -,,5,five ,5.00 +,,2,thirty,30.00 +,,3,twelve,12.00 +,,4,eleven,11.00 +,,5,ten,10.00 +,Lowest,1,one,1.00 +,,2,two,2.00 +,,3,three,3.00 +,,4,four,4.00 +,,5,five,5.00 + +Table: Tests of Normality +,Shapiro-Wilk,, +,Statistic,df,Sig. +x,.37,14,.00 ]) -AT_CLEANUP +AT_CLEANUP dnl Test for a crash which happened on cleanup from a bad input syntax AT_SETUP([EXAMINE -- Bad Input]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine-bad.sps], [dnl data list list /h * g *. @@ -737,7 +776,7 @@ begin data. 9 2 end data. -EXAMINE +EXAMINE /VARIABLES= h BY g /STATISTICS = DESCRIPTIVES EXTREME @@ -747,12 +786,12 @@ EXAMINE AT_CHECK([pspp -o pspp.csv examine-bad.sps], [1], [ignore]) -AT_CLEANUP +AT_CLEANUP dnl Check the MISSING=REPORT option AT_SETUP([EXAMINE -- MISSING=REPORT]) - +AT_KEYWORDS([categorical categoricals]) AT_DATA([examine-report.sps], [dnl set format = F22.0. @@ -802,25 +841,27 @@ EXAMINE ]) -AT_CHECK([pspp -O format=csv examine-report.sps], [0], [dnl -Table: Reading free-form data from INLINE. +AT_CHECK([pspp -o pspp.csv -o pspp.txt examine-report.sps]) +AT_CHECK([cat pspp.csv], [0], + [[Table: Reading free-form data from INLINE. Variable,Format x,F8.0 g,F8.0 Table: Case Processing Summary -,,Cases,,,,, +,g,Cases,,,,, ,,Valid,,Missing,,Total, -,g,N,Percent,N,Percent,N,Percent -x,. (missing),4,100%,0,0%,4,100% -,1,9,100%,0,0%,9,100% -,2,9,100%,0,0%,9,100% -,9 (missing),4,100%,0,0%,4,100% -,99 (missing),5,100%,0,0%,5,100% +,,N,Percent,N,Percent,N,Percent +x,.,4,100.0%,0,.0%,4,100.0% +,1,9,100.0%,0,.0%,9,100.0% +,2,9,100.0%,0,.0%,9,100.0% +,9[a],4,100.0%,0,.0%,4,100.0% +,99[a],5,100.0%,0,.0%,5,100.0% +Footnote: a. User-missing value. Table: Extreme Values ,g,,,Case Number,Value -x,. (missing),Highest,1,31,4004 +x,.,Highest,1,31,4004 ,,,2,30,3003 ,,,3,29,2002 ,,,4,28,1001 @@ -850,7 +891,7 @@ x,. (missing),Highest,1,31,4004 ,,,3,12,30 ,,,4,13,40 ,,,5,14,50 -,9 (missing),Highest,1,22,401 +,9[a],Highest,1,22,401 ,,,2,21,301 ,,,3,20,201 ,,,4,19,101 @@ -860,7 +901,7 @@ x,. (missing),Highest,1,31,4004 ,,,3,21,301 ,,,4,22,401 ,,,5,22,401 -,99 (missing),Highest,1,27,901 +,99[a],Highest,1,27,901 ,,,2,26,801 ,,,3,25,701 ,,,4,24,601 @@ -870,16 +911,17 @@ x,. (missing),Highest,1,31,4004 ,,,3,25,701 ,,,4,26,801 ,,,5,27,901 -]) - +Footnote: a. User-missing value. +]]) -AT_CLEANUP +AT_CLEANUP dnl Run a test of the basic STATISTICS using a "real" dnl dataset and comparing with "real" results kindly dnl provided by Olaf Nöhring AT_SETUP([EXAMINE -- sample unweighted]) +AT_KEYWORDS([categorical categoricals]) AT_DATA([sample.sps], [dnl set format = F22.4. @@ -998,7 +1040,7 @@ Table: Case Processing Summary ,Cases,,,,, ,Valid,,Missing,,Total, ,N,Percent,N,Percent,N,Percent -X,100,100%,0,0%,100,100% +X,100,100.0%,0,.0%,100,100.0% Table: Descriptives ,,,Statistic,Std. Error @@ -1017,4 +1059,307 @@ X,Mean,,587.6603,23.2665 ,Kurtosis,,.5300,.4783 ]) -AT_CLEANUP +AT_CLEANUP + + + +dnl Test for a crash which happened on bad input syntax +AT_SETUP([EXAMINE -- Empty Parentheses]) +AT_KEYWORDS([categorical categoricals]) + +AT_DATA([examine-empty-parens.sps], [dnl +DATA LIST notable LIST /X * +BEGIN DATA. +2 +3 +END DATA. + + +EXAMINE + x + /PLOT = SPREADLEVEL() + . +]) + +AT_CHECK([pspp -o pspp.csv examine-empty-parens.sps], [1], [ignore]) + +AT_CLEANUP + + + + +dnl Test for another crash which happened on bad input syntax +AT_SETUP([EXAMINE -- Bad variable]) +AT_KEYWORDS([categorical categoricals]) + +AT_DATA([examine-bad-variable.sps], [dnl +data list list /h * g *. +begin data. +3 1 +4 1 +5 2 +end data. + +EXAMINE + /VARIABLES/ h + BY g + . +]) + +AT_CHECK([pspp -o pspp.csv examine-bad-variable.sps], [1], [ignore]) + +AT_CLEANUP + + + +dnl Test for yet another crash. This time for extremes vs. missing weight values. +AT_SETUP([EXAMINE -- Extremes vs. Missing Weights]) +AT_KEYWORDS([categorical categoricals]) + +AT_DATA([examine-missing-weights.sps], [dnl +data list notable list /h * g *. +begin data. +3 1 +4 . +5 1 +2 1 +end data. + +WEIGHT BY g. + +EXAMINE h + /STATISTICS extreme(3) + . +]) + +AT_CHECK([pspp -O format=csv examine-missing-weights.sps], [0], [dnl +"examine-missing-weights.sps:13: warning: EXAMINE: At least one case in the data file had a weight value that was user-missing, system-missing, zero, or negative. These case(s) were ignored." + +Table: Case Processing Summary +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +h,3.00,100.0%,.00,.0%,3.00,100.0% + +Table: Extreme Values +,,,Case Number,Value +h,Highest,1,3,5.00 +,,2,2,4.00 +,,3,1,3.00 +,Lowest,1,4,2.00 +,,2,1,3.00 +,,3,2,4.00 +]) + +AT_CLEANUP + +dnl This is an example from doc/tutorial.texi +dnl So if the results of this have to be changed in any way, +dnl make sure to update that file. +AT_SETUP([EXAMINE tutorial example 1]) +cp $top_srcdir/examples/repairs.sav . +AT_DATA([repairs.sps], [dnl +GET FILE='repairs.sav'. +EXAMINE mtbf /STATISTICS=DESCRIPTIVES. +COMPUTE mtbf_ln = LN (mtbf). +EXAMINE mtbf_ln /STATISTICS=DESCRIPTIVES. +]) + +AT_CHECK([pspp -O format=csv repairs.sps], [0], [dnl +Table: Case Processing Summary +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +Mean time between failures (months) ,30,100.0%,0,.0%,30,100.0% + +Table: Descriptives +,,,Statistic,Std. Error +Mean time between failures (months) ,Mean,,8.78,1.10 +,95% Confidence Interval for Mean,Lower Bound,6.53, +,,Upper Bound,11.04, +,5% Trimmed Mean,,8.20, +,Median,,8.29, +,Variance,,36.34, +,Std. Deviation,,6.03, +,Minimum,,1.63, +,Maximum,,26.47, +,Range,,24.84, +,Interquartile Range,,6.03, +,Skewness,,1.65,.43 +,Kurtosis,,3.41,.83 + +Table: Case Processing Summary +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +mtbf_ln,30,100.0%,0,.0%,30,100.0% + +Table: Descriptives +,,,Statistic,Std. Error +mtbf_ln,Mean,,1.95,.13 +,95% Confidence Interval for Mean,Lower Bound,1.69, +,,Upper Bound,2.22, +,5% Trimmed Mean,,1.96, +,Median,,2.11, +,Variance,,.49, +,Std. Deviation,,.70, +,Minimum,,.49, +,Maximum,,3.28, +,Range,,2.79, +,Interquartile Range,,.88, +,Skewness,,-.37,.43 +,Kurtosis,,.01,.83 +]) + +AT_CLEANUP + +dnl This is an example from doc/tutorial.texi +dnl So if the results of this have to be changed in any way, +dnl make sure to update that file. +AT_SETUP([EXAMINE tutorial example 2]) +cp $top_srcdir/examples/physiology.sav . +AT_DATA([examine.sps], [dnl +GET FILE='physiology.sav'. +EXAMINE height, weight /STATISTICS=EXTREME(3). +]) +AT_CHECK([pspp -o pspp.csv -o pspp.txt examine.sps]) +AT_CHECK([cat pspp.csv], [0], [dnl +Table: Case Processing Summary +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +Height in millimeters ,40,100.0%,0,.0%,40,100.0% +Weight in kilograms ,40,100.0%,0,.0%,40,100.0% + +Table: Extreme Values +,,,Case Number,Value +Height in millimeters ,Highest,1,14,1903 +,,2,15,1884 +,,3,12,1802 +,Lowest,1,30,179 +,,2,31,1598 +,,3,28,1601 +Weight in kilograms ,Highest,1,13,92.1 +,,2,5,92.1 +,,3,17,91.7 +,Lowest,1,38,-55.6 +,,2,39,54.5 +,,3,33,55.4 +]) +AT_CLEANUP + + + +AT_SETUP([EXAMINE -- Crash on unrepresentable graphs]) +AT_DATA([examine.sps], [dnl +data list notable list /x * g *. +begin data. +96 1 +end data. + +examine x by g + /nototal + /plot = all. +]) +dnl This bug only manifested itself on cairo based drivers. +AT_CHECK([pspp -O format=pdf examine.sps], [0], [ignore], [ignore]) +AT_CLEANUP + + +dnl This example comes from the web site: +dnl https://www.spsstests.com/2018/11/shapiro-wilk-normality-test-spss.html +AT_SETUP([EXAMINE -- shapiro-wilk 1]) +AT_KEYWORDS([shapiro wilk]) +AT_DATA([shapiro-wilk.sps], [dnl +data list notable list /x * g *. +begin data. +96 1 +98 1 +95 1 +89 1 +90 1 +92 1 +94 1 +93 1 +97 1 +100 1 +99 2 +96 2 +80 2 +89 2 +91 2 +92 2 +93 2 +94 2 +99 2 +80 2 +end data. + +set format F22.3. + +examine x by g + /nototal + /plot = all. +]) + +AT_CHECK([pspp -O format=csv shapiro-wilk.sps], [0],[dnl +Table: Case Processing Summary +,g,Cases,,,,, +,,Valid,,Missing,,Total, +,,N,Percent,N,Percent,N,Percent +x,1.00,10,100.0%,0,.0%,10,100.0% +,2.00,10,100.0%,0,.0%,10,100.0% + +Table: Tests of Normality +,g,Shapiro-Wilk,, +,,Statistic,df,Sig. +x,1.00,.984,10,.983 +,2.00,.882,10,.136 +]) + +AT_CLEANUP + + +dnl This example comes from the web site: +dnl http://www.real-statistics.com/tests-normality-and-symmetry/statistical-tests-normality-symmetry/shapiro-wilk-expanded-test/ +dnl It uses a dataset larger than 11 samples. Hence the alternative method for +dnl signficance is used. +AT_SETUP([EXAMINE -- shapiro-wilk 2]) +AT_KEYWORDS([shapiro wilk]) +AT_DATA([shapiro-wilk2.sps], [dnl +data list notable list /x *. +begin data. +65 +61 +63 +86 +70 +55 +74 +35 +72 +68 +45 +58 +end data. + +set format F22.3. + +examine x + /plot = boxplot. +]) + +AT_CHECK([pspp -O format=csv shapiro-wilk2.sps], [0],[dnl +Table: Case Processing Summary +,Cases,,,,, +,Valid,,Missing,,Total, +,N,Percent,N,Percent,N,Percent +x,12,100.0%,0,.0%,12,100.0% + +Table: Tests of Normality +,Shapiro-Wilk,, +,Statistic,df,Sig. +x,.971,12,.922 +]) + +AT_CLEANUP