From: John Darrington Date: Tue, 31 Mar 2009 07:48:51 +0000 (+0800) Subject: Merge commit 'origin/stable' X-Git-Tag: v0.7.3~176^2~8^2~1 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a331fe64eb814ae5c1322e21717a04fb254bf65;hp=-c;p=pspp-builds.git Merge commit 'origin/stable' --- 9a331fe64eb814ae5c1322e21717a04fb254bf65 diff --combined Smake index 84537ef0,5a76b3c1..4c8d83bc --- a/Smake +++ b/Smake @@@ -5,7 -5,6 +5,7 @@@ GNULIB = ../gnuli GNULIB_TOOL = $(GNULIB)/gnulib-tool GNULIB_MODULES = \ + argp \ assert \ byteswap \ c-ctype \ @@@ -16,6 -15,7 +16,7 @@@ environ \ exit \ fatal-signal \ + fcntl \ fpieee \ fprintf-posix \ full-read \ @@@ -112,7 -112,6 +113,7 @@@ gettextize po/POTFILES.in: for f in `find src \( -name \*.[qc] -o -name \*.glade \) ! -name .\* -print` ; do \ if test $$f = src/libpspp/version.c; then continue; fi; \ + if test $$f = src/ui/gui/psppire-marshal.c; then continue; fi; \ if test -e `dirname $$f`/`basename $$f .c`.q ; then continue; fi; \ echo $$f ; \ done | sort | uniq > $@.tmp diff --combined doc/statistics.texi index 311f5d7a,8fa93b15..98556060 --- a/doc/statistics.texi +++ b/doc/statistics.texi @@@ -14,7 -14,6 +14,7 @@@ far * ONEWAY:: One way analysis of variance. * RANK:: Compute rank scores. * REGRESSION:: Linear regression. +* RELIABILITY:: Reliability analysis. @end menu @node DESCRIPTIVES @@@ -233,7 -232,7 +233,7 @@@ EXAMIN /PLOT=@{BOXPLOT, NPPLOT, HISTOGRAM, ALL, NONE@} /CINTERVAL n /COMPARE=@{GROUPS,VARIABLES@} - /ID=@{case_number, var_name@} + /ID=var_name /@{TOTAL,NOTOTAL@} /PERCENTILE=[value_list]=@{HAVERAGE, WAVERAGE, ROUND, AEMPIRICAL, EMPIRICAL @} /MISSING=@{LISTWISE, PAIRWISE@} [@{EXCLUDE, INCLUDE@}] @@@ -272,12 -271,6 +272,12 @@@ If /COMPARE=VARIABLES is specified, the each containing one boxplot per dependent variable. If the /COMPARE subcommand is ommitted, then PSPP uses the default value of /COMPARE=GROUPS. + +The ID subcommand also pertains to boxplots. If given, it must +specify a variable name. Outliers and extreme cases plotted in +boxplots will be labelled with the case from that variable. Numeric or +string variables are permissible. If the ID subcommand is not given, +then the casenumber will be used for labelling. The CINTERVAL subcommand specifies the confidence interval to use in calculation of the descriptives command. The default it 95%. @@@ -506,8 -499,6 +506,8 @@@ NPAR TEST [ /STATISTICS=@{DESCRIPTIVES@} ] [ /MISSING=@{ANALYSIS, LISTWISE@} @{INCLUDE, EXCLUDE@} ] + + [ /METHOD=EXACT [ TIMER [(n)] ] ] @end display NPAR TESTS performs nonparametric tests. @@@ -517,21 -508,10 +517,21 @@@ One or more tests may be specified by u If the /STATISTICS subcommand is also specified, then summary statistics are produces for each variable that is the subject of any test. +Certain tests may take a long time to execute, if an exact figure is required. +Therefore, by default asymptotic approximations are used unless the +subcommand /METHOD=EXACT is specified. +Exact tests give more accurate results, but may take an unacceptably long +time to perform. If the TIMER keyword is used, it sets a maximum time, +after which the test will be abandoned, and a warning message printed. +The time, in minutes, should be specified in parentheses after the TIMER keyword. +If the TIMER keyword is given without this figure, then a default value of 5 minutes +is used. + @menu * BINOMIAL:: Binomial Test * CHISQUARE:: Chisquare Test +* WILCOXON:: Wilcoxon Signed Ranks Test @end menu @@@ -566,7 -546,7 +566,7 @@@ values If more than two distinct, non-missing values for a variable under test are encountered then an error occurs. - If the test proportion is equal to 0.5, then a one tailed test is + If the test proportion is equal to 0.5, then a two tailed test is reported. For any other test proportion, a one tailed test is reported. For one tailed tests, if the test proportion is less than @@@ -611,34 -591,6 +611,34 @@@ sum of the frequencies need not be 1 If no /EXPECTED subcommand is given, then then equal frequencies are expected. +@node WILCOXON +@subsection Wilcoxon +@comment node-name, next, previous, up +@vindex WILCOXON +@cindex wilcoxon matched pairs signed ranks test + +@display + [ /WILCOXON varlist [ WITH varlist [ (PAIRED) ]]] +@end display + +The wilcoxon subcommand tests for differences between means of the +variables listed. The test does not make any assumptions about the +variances of the samples. + +If the @code{WITH} keyword is omitted, then tests for all +combinations of the listed variables are performed. +If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword +is also given, then the number of variables preceding @code{WITH} +must be the same as the number following it. +In this case, tests for each respective pair of variables are +performed. +If the @code{WITH} keyword is given, but the +@code{(PAIRED)} keyword is omitted, then tests for each combination +of variable preceding @code{WITH} against variable following +@code{WITH} are performed. + +If the number of observations is large, and exact tests have been +requested. then the test may take a very long time to complete. @node T-TEST @comment node-name, next, previous, up @@@ -814,6 -766,7 +814,6 @@@ If the total sum of the coefficients ar display a warning, but will proceed with the analysis. The @code{CONTRAST} subcommand may be given up to 10 times in order to specify different contrast tests. -@setfilename ignored @node RANK @comment node-name, next, previous, up @@@ -878,50 -831,3 +878,50 @@@ user-missing are to be excluded from th INCLUDE means they are to be included. The default is EXCLUDE. @include regression.texi + + +@node RELIABILITY +@section RELIABILITY + +@vindex RELIABILITY +@display +RELIABILITY + /VARIABLES=var_list + /SCALE (@var{name}) = @{var_list, ALL@} + /MODEL=@{ALPHA, SPLIT[(N)]@} + /SUMMARY=@{TOTAL,ALL@} + /MISSING=@{EXCLUDE,INCLUDE@} +@end display + +@cindex Cronbach's Alpha +The @cmd{RELIABILTY} command performs reliablity analysis on the data. + +The VARIABLES subcommand is required. It determines the set of variables +upon which analysis is to be performed. + +The SCALE subcommand determines which variables reliability is to be +calculated for. If it is omitted, then analysis for all variables named +in the VARIABLES subcommand will be used. +Optionally, the @var{name} parameter may be specified to set a string name +for the scale. + +The MODEL subcommand determines the type of analysis. If ALPHA is specified, +then Cronbach's Alpha is calculated for the scale. If the model is SPLIT, +then the variables are divided into 2 subsets. An optional parameter +@var{N} may be given, to specify how many variables to be in the first subset. +If @var{N} is omitted, then it defaults to one half of the variables in the +scale, or one half minus one if there are an odd number of variables. +The default model is ALPHA. + +By default, any cases with user missing, or system missing values for +any variables given +in the VARIABLES subcommand will be omitted from analysis. +The MISSING subcommand determines whether user missing values are to +be included or excluded in the analysis. + +The SUMMARY subcommand determines the type of summary analysis to be performed. +Currently there is only one type: SUMMARY=TOTAL, which displays per-item +analysis tested against the totals. + + + diff --combined src/data/por-file-writer.c index 77396930,a50563ab..8de293c5 --- a/src/data/por-file-writer.c +++ b/src/data/por-file-writer.c @@@ -1,5 -1,5 +1,5 @@@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2006, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@@ -215,7 -215,8 +215,8 @@@ write_float (struct pfm_writer *w, doub char buffer[64]; format_trig_double (d, floor (d) == d ? DBL_DIG : w->digits, buffer); buf_write (w, buffer, strlen (buffer)); - buf_write (w, "/", 1); + if (d != SYSMIS) + buf_write (w, "/", 1); } /* Write N to the portable file as an integer field. */ @@@ -463,7 -464,7 +464,7 @@@ por_file_casewriter_write (struct casew else casewriter_force_error (writer); - case_destroy (c); + case_unref (c); } static void diff --combined src/data/psql-reader.c index a54b9f8b,9df82b55..be6d0a60 --- a/src/data/psql-reader.c +++ b/src/data/psql-reader.c @@@ -1,5 -1,5 +1,5 @@@ /* PSPP - a program for statistical analysis. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@@ -37,7 -37,7 +37,7 @@@ #if !PSQL_SUPPORT struct casereader * -psql_open_reader (struct psql_read_info *info, struct dictionary **dict) +psql_open_reader (struct psql_read_info *info UNUSED, struct dictionary **dict UNUSED) { msg (ME, _("Support for reading postgres databases was not compiled into this installation of PSPP")); @@@ -75,7 -75,8 +75,7 @@@ static void psql_casereader_destroy (struct casereader *reader UNUSED, void *r_); -static bool psql_casereader_read (struct casereader *, void *, - struct ccase *); +static struct ccase *psql_casereader_read (struct casereader *, void *); static const struct casereader_class psql_casereader_class = { @@@ -108,7 -109,8 +108,7 @@@ struct psql_reade }; -static bool set_value (struct psql_reader *r, - struct ccase *cc); +static struct ccase *set_value (struct psql_reader *r); @@@ -440,6 -442,10 +440,10 @@@ psql_open_reader (struct psql_read_inf break; } + if ( width == 0 && fmt_is_string (fmt.type)) + fmt.w = width = MAX_SHORT_STRING; + + var = create_var (r, &fmt, width, PQfname (qres, i), i); if ( type == NUMERICOID && n_tuples > 0) { @@@ -544,8 -550,9 +548,8 @@@ psql_casereader_destroy (struct caserea -static bool -psql_casereader_read (struct casereader *reader UNUSED, void *r_, - struct ccase *cc) +static struct ccase * +psql_casereader_read (struct casereader *reader UNUSED, void *r_) { struct psql_reader *r = r_; @@@ -555,24 -562,24 +559,24 @@@ return false; } - return set_value (r, cc); + return set_value (r); } -static bool -set_value (struct psql_reader *r, - struct ccase *c) +static struct ccase * +set_value (struct psql_reader *r) { - int i; + struct ccase *c; int n_vars; + int i; assert (r->res); n_vars = PQnfields (r->res); if ( r->tuple >= PQntuples (r->res)) - return false; + return NULL; - case_create (c, r->value_cnt); + c = case_create (r->value_cnt); memset (case_data_rw_idx (c, 0)->s, ' ', MAX_SHORT_STRING * r->value_cnt); @@@ -867,7 -874,7 +871,7 @@@ r->tuple++; - return true; + return c; } #endif