Allow output files to overwrite input files (bug #21280). Thanks to
[pspp-builds.git] / src / language / stats / ChangeLog
1 2007-11-03  Ben Pfaff  <blp@gnu.org>
2
3         Allow output files to overwrite input files (bug #21280).
4
5         * aggregate.c (cmd_aggregate): Manage file handle reference
6         counts.
7
8         * correlations.q (internal_cmd_frequencies): Ditto.
9         (cor_custom_matrix): Ditto.
10
11         * regression.q (regression_custom_export): Ditto.
12         (cmd_regression): Ditto.
13
14 2007-10-12  Ben Pfaff  <blp@gnu.org>
15
16         * flip.c (flip_file): No need to conditionally substitute for
17         "fseeko" and "off_t" manually anymore, as gnulib takes care of it
18         for us.
19
20 2007-09-21  Jason Stover  <jhs@wonko.gcsu.edu>
21
22         * regression.q (run_regression): Partial fix of memory leak, bug
23         21056.
24
25 2007-09-19  Ben Pfaff  <blp@gnu.org>
26
27         Fix bug #21108.
28         
29         * aggregate.c (cmd_aggregate): Destroy casereader consistently,
30         even if casereader fails.
31
32         * examine.q (run_examine): Ditto.
33          
34         * glm.q (run_glm): Ditto.
35
36         * oneway.q (run_oneway): Ditto.
37
38         * regression.q (run_regression): Ditto.
39
40         * t-test.q (calculate): Ditto.
41
42         * descriptives.c (calc_descriptives): Ditto.  Also avoid
43         gratuitous casereader_clone.
44
45 2007-09-13  Jason Stover  <jhs@debs.hoobahooba.net>
46
47         * regression.q (cmd_regression): Move declaration of models in to
48         definition of cmd_regression.
49
50         * regression.q (run_regression): Free mom to fix memory leak.
51
52 2007-09-12  Ben Pfaff  <blp@gnu.org>
53
54         * crosstabs.q (postcalc): Free sorted_tab and the structures that
55         it points to, to plug a memory leak.  Fixes bug #20910.  Thanks to
56         John Darrington for reporting this bug and for review.
57
58 2007-09-04  Ben Pfaff  <blp@gnu.org>
59
60         * crosstabs.q (cmd_crosstabs): Free xtab and the structures that
61         it points to, to plug a memory leak.  Fixes bug #18315.
62
63 2007-08-15  Jason Stover  <jhs@wonko.gcsu.edu>
64
65         * regression.q (identify_indep_vars): Print an error if dependent
66         and independent variables are the same. Fixes bug 19819.
67
68 2007-08-12  Ben Pfaff  <blp@gnu.org>
69
70         * flip.c: Drop use of dict_get_compacted_dict_index_to_case_index
71         and just use the ordinary case indexes.  There seemed to be no
72         reason for the former method.
73
74 2007-08-03  Ben Pfaff  <blp@gnu.org>
75
76         * rank.q (rank_cmd): Instead of sorting by SPLIT FILE vars, group
77         by them.  Fixes bug #17239.
78         Reviewed by John Darrington.
79
80 2007-08-01  Ben Pfaff  <blp@gnu.org>
81
82         Clean up handling of median, by treating it almost like any other
83         percentile.  Fixes bug #17424.  Thanks to John Darrington for
84         review.
85         * frequencies.q (internal_cmd_frequencies): Fix handling of bit
86         masks for `stats' variable.  If median is selected, turn it off
87         and add a 50th percentile.
88         (add_percentile): Simplify code a little.
89         (calc_stats): Drop special casing of median.
90         (dump_statistics): Ditto, except that we label the 50th percentile
91         as "50 (Median)" to make it clear that it's also the median.    
92
93 2007-07-31  Ben Pfaff  <blp@gnu.org>
94
95         Remove integer mode from FREQUENCIES and incidentally fix bug
96         #17421.  Reviewed by John Darrington.
97         * frequencies.q (int_pool): Rename data_pool.
98         (gen_pool): Rename syntax_pool.
99         (enum FRQM_*): Removed.
100         (struct freq_tab): Removed `mode', `vector', `min', `max',
101         `out_of_range', `sysmis' members.
102         (calc): Delete support for integer mode.
103         (precalc): Ditto.
104         (postprocess_freq_tab): Ditto.
105         (cleanup_freq_tab): Ditto.
106         (frq_custom_variables): Ditto.
107
108 2007-07-28 John Darrington <john@darrington.wattle.id.au>
109
110         * t-test.q: Moved the order in which groups are displayed in the 
111         independent samples case, where a cut point is given.
112
113 2007-07-27  Ben Pfaff  <blp@gnu.org>
114
115         * regression.q (run_regression): Move casereader_destroy call so
116         that it always gets called, not just if there was some valid
117         data.  Fixes bug #19581.
118         Reviewed by Jason Stover.
119
120 2007-07-24  Ben Pfaff  <blp@gnu.org>
121
122         * flip.c (struct flip_pgm): Remove `case_size' member (now
123         unused).
124         (cmd_flip): Pass var_cnt as number of cases instead of case_cnt,
125         to fix bug #20494.  Don't assign to `case_size' member, which was
126         unused after assignment.
127         (build_dictionary): When NEWNAMES not used, get the number of
128         variables right, to fix bug #20493.
129
130 2007-07-10  Jason Stover  <jhs@math.gcsu.edu>
131
132         * glm.q: Initial version of the GLM procedure.
133
134 2007-06-06  Ben Pfaff  <blp@gnu.org>
135
136         Adapt case sources, sinks, and clients of procedure code to the
137         new infrastructure.
138         
139         * aggregate.c: Simplify greatly since everything is more uniform
140         now.
141
142         * autorecode.c: Adapt to new procedure code.
143         * binomial.c: Ditto.
144         * chisquare.c: Ditto.
145         * crosstabs.q: Ditto.
146         * descriptives.c: Ditto.
147         * examine.q: Ditto.
148         * npar-summary.c: Ditto.
149         * frequencies.q: Ditto.
150         * npar.q: Ditto.
151         * oneway.q: Ditto.
152         * regression.q: Ditto.
153         * sort-cases.c: Ditto.
154         * t-test.c: Ditto.
155
156         * sort-criteria.c: Rewrite to output a struct case_ordering.
157         
158         * flip.c: Rewrite to be a casereader.
159
160         * rank.q: Simplify greatly since casereaders are much more
161         flexible than what we had before.
162         
163 2007-05-15  Jason Stover  <jhs@math.gcsu.edu>
164
165         * regression.q (run_regression): Tell the user when the data
166         contain no valid cases.
167
168 2007-05-08  Jason Stover  <jhs@math.gcsu.edu>
169
170         * regression.q: Partial fix of bug which caused a crash if
171         dependent variable and independent variable were the same.
172
173 2007-04-16 John Darrington <john@darrington.wattle.id.au>
174
175         * t-test.q: Changed the output width of reported counts and 
176         degrees of freedom, to avoid truncating these values.  Thanks
177         to Seth Woolley for reporting this problem.  A proper fix involves
178         re-thinking the output driver.
179
180 2007-04-12  Jason Stover  <jhs@math.gcsu.edu>
181
182         * regression.q (run_regression): Added if (n_data >0) to fix bug
183         19581.
184
185 2007-03-29  Jason Stover  <jhs@math.gcsu.edu>
186
187         * regression.q (prepare_data): New function.
188
189         * regression.q (compute_moments): New function.
190
191 2007-03-18  Ben Pfaff  <blp@gnu.org>
192
193         * crosstabs.q (static var write): Rename write_style to avoid
194         conflict with POSIX function of same name.
195
196 2007-03-16  Jason Stover  <jhs@math.gcsu.edu>
197
198         * regression.q (run_regression): Added support for moments.
199
200 Sat Feb 17 08:16:00 2007  Ben Pfaff  <blp@gnu.org>
201
202         * flip.c (flip_sink_create): Improve error message when temporary
203         file cannot be created.
204
205 Tue Feb  6 19:58:03 2007  Ben Pfaff  <blp@gnu.org>
206
207         * flip.c (flip_file): Give better error message on end-of-file.
208
209 2007-02-04  Jason Stover  <jhs@math.gcsu.edu>
210
211         * regression.q: Fixed p-value computation in the test for
212         individual regression coefficients.
213
214 Mon Jan 15 11:03:20 2007  Ben Pfaff  <blp@gnu.org>
215
216         Fix bugs found by valgrind when --enable-debug is used with the
217         new case code.  These bugs are hidden when the data set is small
218         enough to find in memory; if a bigger data set that would overflow
219         to disk were used, then data corruption would occur.
220
221         * chisquare.c (create_freq_hash): Pass free_freq_mutable_hash to
222         hsh_create as free function.  Make copy of data put into hash.
223
224         * oneway.q (free_value): New function.
225         (run_oneway): Use free_value as arg to hsh_create.  Make copy of
226         data put into hash.
227
228         * rank.q (rank_cases): Don't access data in case after we've given
229         away the case.
230
231 Tue Jan  9 19:16:11 2007  Ben Pfaff  <blp@gnu.org>
232
233         Fix bug #18739.
234         
235         * aggregate.c (parse_aggregate_functions) Initialize
236         function_name.
237
238 Fri Dec 22 14:04:09 2006  Ben Pfaff  <blp@gnu.org>
239
240         Simplify missing value handling.
241         
242         * aggregate.c (struct agr_var): Remove `bool include_missing', add
243         `enum mv_class exclude'.  Remove `int missing', add `bool
244         saw_missing'.  Update users.
245
246         * descriptives.c (struct dsc_trns): Removed `int
247         include_user_missing', add `enum mv_class exclude'.  Update users.
248         (struct dsc_proc): Ditto.
249
250         * examine.q: (static var value_is_missing): Rename
251         `exclude_values', change type to `enum mv_class'.  Update users.
252
253         * rank.q: Ditto.
254
255 Fri Dec 22 19:22:18 WST 2006 John Darrington <john@darrington.wattle.id.au>
256
257         * frequencies.q : Fixed bug #17420, where the table bounds were overun
258         when /FORMAT=nolabels was given.
259
260 Wed Dec 20 18:45:31 WST 2006 John Darrington <john@darrington.wattle.id.au>
261
262         * binomial.c binomial.h : New files.  Thanks to Jason Stover 
263           for assistance with these.
264
265         * chisquare.c chisquare.h freq.c freq.h npar-summary.c npar-summary.h 
266           npar.h npar.q: New files.  Implementing NPAR TESTS.
267
268         * frequencies.q  : Moved  structure definitions into freq.[ch]
269
270 Sat Dec 16 22:26:44 2006  Ben Pfaff  <blp@gnu.org>
271
272         Make it possible to pull cases from the active file with a
273         function call, instead of requiring indirection through a callback
274         function.
275
276         * aggregate.c (cmd_aggregate): Take advantage of new procedure
277         interface.
278         (agr_to_active_file): Removed.
279         (presorted_agr_to_sysfile): Removed.
280
281         * autorecode.c (cmd_autorecode): Take advantage of new procedure
282         interface.
283         (autorecode_proc_func): Removed.
284
285         * flip.c (struct flip_pgm): New members to allow conformance with
286         new case_source_class interface.
287         (cmd_flip): Adapt to new case_source_class interface.
288         (flip_source_read): Ditto.
289         (flip_source_destroy): Ditto.
290
291 Sat Dec 16 12:54:27 2006  Ben Pfaff  <blp@gnu.org>
292
293         * rank.q (rank_custom_variables): Allow grouping variables to be
294         strings.  Fixes bug #18533.  Thanks to John Darrington for review.
295
296 Sat Dec  9 18:47:51 2006  Ben Pfaff  <blp@gnu.org>
297
298         * regression.q (is_depvar): Compare variable pointers instead of
299         variable names.
300
301 Thu Dec  7 15:26:25 WST 2006 John Darrington <john@darrington.wattle.id.au>
302
303         * examine.q: Allocated the categorical values for the dependent and 
304         independent variables, on the heap.  Hence they can be of any width.
305
306 Wed Dec  6 21:14:26 2006  Ben Pfaff  <blp@gnu.org>
307
308         * regression.q (reg_inserted): Compare variable pointers instead
309         of variable indexes.
310
311 Mon Dec  4 22:33:46 2006  Ben Pfaff  <blp@gnu.org>
312
313         * crosstabs.q (insert_summary): Use var_to_string for labeling.
314         (output_pivot_table) Ditto.
315         (submit) Ditto.
316
317         * frequencies.q (setup_z_trns): Ditto.
318         (dump_full) Ditto.
319         (dump_condensed) Ditto.
320         (dump_statistics) Ditto.
321         
322
323 Sun Nov  5 08:31:42 WST 2006 John Darrington <john@darrington.wattle.id.au>
324
325         * t-test.q, oneway.q: Changed to use the new casefilter structure.
326
327 Sat Oct 14 16:52:28 2006  Ben Pfaff  <blp@gnu.org>
328
329         * rank.q: (rank_sorted_casefile) Add some missing case_destroy()
330         calls to fix a memory leak.
331
332 Sun Oct  8 09:45:40 WST 2006 John Darrington <john@darrington.wattle.id.au>
333
334         * rank.q: Plugged a small memory leak which occurred under error
335         conditions.
336         
337 Sat Oct  7 11:06:01 WST 2006 John Darrington <john@darrington.wattle.id.au>
338
339         * rank.q: Implemented most of the RANK command.
340
341 2006-07-14  Jason Stover  <jhs@math.gcsu.edu>
342
343         * regression.q (run_regression): New function to move knowledge of
344         pspp_linreg_cache out of math/coefficient.[ch].
345
346 Sat Jul  1 17:41:46 2006  Ben Pfaff  <blp@gnu.org>
347
348         Fix bug #11612, "q2c documentation does not agree with code".
349         
350         * examine.q: Audit use of q2c "+" prefixes that indicate that a
351         command may appear multiple times.
352
353         * frequencies.q: Ditto.
354
355         * oneway.q: Ditto.
356
357         * regression.q: Ditto.
358
359         * t-test.q: Ditto.
360
361 Fri Jun 23 14:18:22 2006  Ben Pfaff  <blp@gnu.org>
362
363         Support long string variables on FREQUENCIES, as
364         an extension when in enhanced algorithms mode.  For Greg Hunt
365         <greg@firmansyah.com>.
366         
367         * frequencies.q: (struct freq) Change `v' member from union value
368         to union value *.  Update all references.
369         (struct var_freqs) Add width, print members to represent effective
370         variable width and display format.
371         (calc) Copy entire long string value into the hash table.
372         (frq_custom_variables) Set new width, print members.
373         (hash_value_alpha) Get width from var_freqs.
374         (compare_value_alpha_a) Ditto.
375         (compare_freq_alpha_a) Ditto.
376         (compare_freq_alpha_d) Ditto.
377         (dump_full) Get display format from var_freqs.
378         (dump_condensed) Ditto.
379
380 Mon Jun 19 22:07:13 2006  Ben Pfaff  <blp@gnu.org>
381
382         * frequencies.q: (dump_full) Only put the first MAX_SHORT_STRING
383         bytes of string variables into the output cells, seeing as we only
384         copy that many.
385         (dump_condensed) Ditto.
386
387 Mon Jun 19 21:52:05 2006  Ben Pfaff  <blp@gnu.org>
388
389         Fixes a bug reported by Greg Hunt <greg@firmansyah.com>.
390         
391         * frequencies.q: (hsh_hash_bytes) We only copy the first
392         MAX_SHORT_STRING bytes of string variables, so we must only
393         compare that many bytes, even if the string variable is longer.
394         (compare_value_alpha_a) Ditto.
395         (compare_freq_alpha_a) Ditto.
396         (compare_freq_alpha_d) Ditto.
397
398 2006-05-11  Jason Stover  <jhs@math.gcsu.edu>
399
400         * regression.q: Adjusted code to account for cache->coeff being a
401         pspp_linreg_coeff **.
402
403 Sun May  7 18:31:25 2006  Ben Pfaff  <blp@gnu.org>
404
405         Fix memory leak.
406         
407         * aggregate.c (cmd_aggregate): Free default_dict before replacing
408         it.
409
410 Sun May  7 17:09:19 2006  Ben Pfaff  <blp@gnu.org>
411
412         * flip.c (flip_file): Check return value of pool_fclose().
413
414 Sat May  6 16:00:13 2006  Ben Pfaff  <blp@gnu.org>
415
416         Get rid of `char *c' member in union value, for cleanliness.
417         
418         * aggregate.c: (union agr_argument) New union.
419         (struct agr_var) Change element type of arg[] from union value to
420         union agr_argument.
421         (parse_aggregate_functions) Change local variable types likewise.
422
423         * autorecode.c: (union arc_value) New union.
424         (struct arc_item) Change "from" from union value to union
425         arc_value.
426         (recode) Change local variable from union value to union
427         arc_value.
428         (autorecode_trns_proc) Ditto.
429         (compare_alpha_value) Ditto.
430         (hash_alpha_value) Ditto.
431         (compare_numeric_value) Ditto.
432         (hash_numeric_value) Ditto.
433         (autorecode_proc_func) Ditto.
434
435 Sat May  6 10:43:33 2006  Ben Pfaff  <blp@gnu.org>
436
437         Continue reforming procedure execution.  In this phase, get rid of
438         the output code for SPLIT FILE groups in procedure.c, which really
439         shouldn't be doing any output.  Move it into the individual
440         procedures instead.  This also adds some flexibility.
441
442         * crosstabs.q (precalc): Call output_split_file_values().
443
444         * descriptives.c (calc_descriptives): Ditto.
445
446         * examine.q (run_examine): Ditto.
447         
448         * frequencies.q (precalc): Ditto.
449
450         * oneway.q (run_oneway): Ditto.
451
452         * regression.q (run_regression): Ditto.
453
454         * t-test.q (calculate): Ditto.
455
456 Wed May  3 23:05:31 2006  Ben Pfaff  <blp@gnu.org>
457
458         Continue reforming procedure execution.  In this phase, get rid of
459         many global variables, consolidating procedure execution in
460         procedure.c.  Encapsulate transformations in new "struct
461         trns_chain".  Also, change implementation of N OF CASES, FILTER,
462         and PROCESS IF from special cases to transformations.
463          
464         * aggregate.c (cmd_aggregate) Use discard_variables().
465         
466 2006-04-28  Jason Stover  <jhs@math.gcsu.edu>
467
468         * regression.q (regression_trns_resid_proc): Pass only the
469         variables used in the model to (*model->residual)().
470
471         * regression.q (regression_trns_pred_proc): Pass only the
472         variables used in the model to (*model->pred)().
473
474 2006-04-26  Jason Stover  <jhs@math.gcsu.edu>
475
476         * regression.q: Added support for multiple transformations.
477         
478         * regression.q (regression_trns_resid_proc): New function.
479
480         * regression.q (regression_trns_pred_proc): New function.
481
482         * regression.q (subcommand_save): Added support for saving
483         predicted values.
484
485         * regression.q (regression_trns_free): New function. 
486
487         * regression.q (reg_get_name): New function.
488
489         * regression.q (reg_save_var): New function.
490
491 Tue Apr 25 13:18:56 2006  Ben Pfaff  <blp@gnu.org>
492
493         * rank.q (parse_rank_function): Use SE instead of ME for parse
494         errors.
495
496 Tue Apr 25 13:16:28 2006  Ben Pfaff  <blp@gnu.org>
497
498         * flip.c (flip_sink_write): Use snprintf() to simplify a bit of
499         code.
500
501 2006-04-21  Jason Stover  <jhs@math.gcsu.edu>
502
503         * regression.q (try_name): New function. (Partly copied from
504         try_name in descriptives.c.)
505
506         * regression.q (subcommand_save): Choose residual variable names
507         correctly. 
508
509 2006-04-20  Jason Stover  <jhs@math.gcsu.edu>
510
511         * regression.q (cmd_regression): Moved call to subcommand_save()
512         outside multipass_procedure_with_splits().
513         
514         * regression.q (regression_trns_proc): Fixed value counter n_vals
515         before calling *model->residual().
516
517 2006-04-19  Jason Stover  <jhs@math.gcsu.edu>
518
519         * regression.q (regression_trns_proc): Fixed the look-up of the
520         number of variables.
521
522 2006-04-18  Jason Stover  <jhs@math.gcsu.edu>
523
524         * regression.q (regression_trns_proc): Look up the residual
525         variable in the linear regression cache.
526
527         * regression.q (subcommand_save): Set the residual variable in the
528         linear regression cache.
529
530 2006-04-17  Jason Stover  <jason@wonko.gcsu.edu>
531
532         * regression.q (regression_trns_proc): Accept case_idx as an int
533         to match the definition of trns_proc_func.
534
535 2006-04-17  Jason Stover  <jhs@math.gcsu.edu>
536
537         * regression.q (regression_trns_proc): New function.
538
539         * regression.q (subcommand_save): Create variable residuals and
540         add a transformation to assign values to them. Also free the
541         linreg_cache if the SAVE command was not called. Removed the
542         casereading loop. Placed actual computation of residuals in
543         regression_trns_proc.
544
545         * regression.q (run_regression): Moved call to free
546         pspp_linreg_cache to subcommand_save.
547
548 Sat Apr 15 18:01:03 2006  Ben Pfaff  <blp@gnu.org>
549
550         * examine.q (output_examine): Add casts to fix warnings.
551
552 2006-04-07  Jason Stover  <jhs@math.gcsu.edu>
553
554         * regression.q (subcommand_save): New function.
555
556 2006-04-04  Jason Stover  <jhs@math.gcsu.edu>
557
558         * regression.q: New function reg_has_categorical () to tell
559         whether a pspp_linreg_struct was made with any variables of type
560         ALPHA.
561
562         * regression.q: (subcommand_export): Call
563         reg_print_categorical_encoding() only if the model uses any
564         categorical variables.
565
566 Mon Mar 27 16:00:42 2006  Ben Pfaff  <blp@gnu.org>
567
568         * crosstabs.q: (output_pivot_table) Drop spurious space from
569         message.
570
571 2006-03-15  Jason Stover  <jhs@math.gcsu.edu>
572
573         * regression.q: Added custom syntax parser for VARIABLES subcommand
574
575         * regression.q: Moved most instructions for run_regression ()
576         inside the loop over dependent variables.
577
578 Thu Mar  2 08:40:33 WST 2006 John Darrington <john@darrington.wattle.id.au>
579         
580         * Moved files from src directory