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