Correct documentation example and add a corresponding test.
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 3 Jan 2015 10:37:11 +0000 (11:37 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 3 Jan 2015 10:37:11 +0000 (11:37 +0100)
The tutorial section of the manual contained an example which
did not correspond to real results.  This change corrects the
example and adds a test for it.

Reported-by: Robin Reeves <robin.r@hotmail.co.uk>
doc/tutorial.texi
examples/hotel.sav
tests/language/stats/reliability.at

index 757a49fbf7b6a4e47fdebba0af84ca558bd66275..65fcbbfa1ab25b212f0bffa9930424746000dbe0 100644 (file)
@@ -492,14 +492,14 @@ A sensible check to perform on survey data is the calculation of
 reliability.
 This gives the statistician some confidence that the questionnaires have been 
 completed thoughtfully.
-If you examine the labels of variables @var{v1},  @var{v3} and @var{v5},
+If you examine the labels of variables @var{v1},  @var{v3} and @var{v4},
 you will notice that they ask very similar questions.
 One would therefore expect the values of these variables (after recoding) 
 to closely follow one another, and we can test that with the @cmd{RELIABILITY} 
 command (@pxref{RELIABILITY}).
 @ref{reliability} shows a @pspp{} session where the user (after recoding
 negatively scaled variables) requests reliability statistics for
-@var{v1}, @var{v3} and @var{v5}.
+@var{v1}, @var{v3} and @var{v4}.
 
 @float Example, reliability
 @cartouche
@@ -509,7 +509,7 @@ negatively scaled variables) requests reliability statistics for
 @prompt{PSPP>} * recode negatively worded questions.
 @prompt{PSPP>} compute v3 = 6 - v3.
 @prompt{PSPP>} compute v5 = 6 - v5.
-@prompt{PSPP>} reliability v1, v3, v5.
+@prompt{PSPP>} reliability v1, v3, v4.
 @end example
 
 Output (dictionary information omitted for clarity):
@@ -527,19 +527,19 @@ Output (dictionary information omitted for clarity):
 #================#==========#
 #Cronbach's Alpha#N of Items#
 #================#==========#
-#             .86#         3#
+#             .81#         3#
 #================#==========#
 @end example
 @end cartouche
 @caption{Recoding negatively scaled variables, and testing for
 reliability with the @cmd{RELIABILITY} command. The Cronbach Alpha
 coefficient suggests a high degree of reliability among variables
-@var{v1}, @var{v2} and @var{v5}.}
+@var{v1}, @var{v3} and @var{v4}.}
 @end float
 
 As a rule of thumb, many statisticians consider a value of Cronbach's Alpha of 
 0.7 or higher to indicate reliable data.
-Here, the value is 0.86 so the data and the recoding that we performed 
+Here, the value is 0.81 so the data and the recoding that we performed 
 are vindicated.
 
 
index 49f6318bc3ff685f01d240d5d25c6b6896706648..e5ddd43ffda6f0d1fcad50a87f052b20905752a0 100644 (file)
Binary files a/examples/hotel.sav and b/examples/hotel.sav differ
index dcae7d517ad5e44e367e70f01a425e293327d846..28fadab8df892761e495e21a4b30d5d7c78c8e99 100644 (file)
@@ -297,3 +297,35 @@ reliability variables=f01 to f10.
 AT_CHECK([pspp -O format=csv reliability.sps], [0], [])
 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([RELIABILITY tutorial example])
+AT_DATA([tut-example.sps], [dnl
+get file='hotel.sav'.
+
+compute v3 = 6 - v3.
+compute v5 = 6 - v5.
+
+reliability variables = v1 v3 v4.
+])
+
+AT_CHECK([ln -s $top_srcdir/examples/hotel.sav .], [0])
+AT_CHECK([pspp -O format=csv tut-example.sps], [0], [dnl 
+Scale: ANY
+
+Table: Case Processing Summary
+,,N,%
+Cases,Valid,17,100.00
+,Excluded,0,.00
+,Total,17,100.00
+
+Table: Reliability Statistics
+Cronbach's Alpha,N of Items
+.81,3
+])
+
+AT_CLEANUP