From cc87b4045df9aab8a7c42426ba755a5801309e72 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 3 Jan 2015 11:37:11 +0100 Subject: [PATCH] Correct documentation example and add a corresponding test. 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 --- doc/tutorial.texi | 12 +++++------ examples/hotel.sav | Bin 1578 -> 1129 bytes tests/language/stats/reliability.at | 32 ++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/doc/tutorial.texi b/doc/tutorial.texi index 757a49fbf7..65fcbbfa1a 100644 --- a/doc/tutorial.texi +++ b/doc/tutorial.texi @@ -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. diff --git a/examples/hotel.sav b/examples/hotel.sav index 49f6318bc3ff685f01d240d5d25c6b6896706648..e5ddd43ffda6f0d1fcad50a87f052b20905752a0 100644 GIT binary patch delta 243 zcmZ3*^O9qNGP8xA$wW0XK?7q2uf#kBLsJ7wD^pV|V}pr>HWM3IHm?28D9Fmdz`zK^ zOhC*G#4MBVvPesDfLK8M9|%CQFcmNVP8MQa9xVhF@(0pohE^&LLHRkU8tMk>T$=i2 zMreFvG`dAO$Cyv PnW<^1nVD&6Kz9HDAOmX@B8 po|>MTmYJRkL}{5Bll54XBthco>8Tm1sX)2Z%+$2BOrQ`@I{+tKE#3eC diff --git a/tests/language/stats/reliability.at b/tests/language/stats/reliability.at index dcae7d517a..28fadab8df 100644 --- a/tests/language/stats/reliability.at +++ b/tests/language/stats/reliability.at @@ -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 -- 2.30.2