static void show_contrast_tests(void);
+enum stat_table_t {STAT_DESC, STAT_HOMO};
+
+static enum stat_table_t stat_tables ;
+
int
cmd_oneway(void)
else
value_is_missing = is_missing;
+ /* What statistics were requested */
+ if ( cmd.sbc_statistics )
+ {
+
+ for (i = 0 ; i < ONEWAY_ST_count ; ++i )
+ {
+ if ( ! cmd.a_statistics[i] ) continue;
+
+ switch (i) {
+ case ONEWAY_ST_DESCRIPTIVES:
+ stat_tables |= STAT_DESC;
+ break;
+ case ONEWAY_ST_HOMOGENEITY:
+ stat_tables |= STAT_HOMO;
+ break;
+ }
+ }
+ }
+
multipass_procedure_with_splits (calculate, &cmd);
/* Check the sanity of the given contrast values */
msg(SW,_("Coefficients for contrast %d do not total zero"),i + 1);
}
+ if ( stat_tables & STAT_DESC )
+ show_descriptives();
-
- /* Show the statistics tables */
- if ( cmd.sbc_statistics )
- {
- for (i = 0 ; i < ONEWAY_ST_count ; ++i )
- {
- if ( ! cmd.a_statistics[i] ) continue;
-
- switch (i) {
- case ONEWAY_ST_DESCRIPTIVES:
- show_descriptives();
- break;
- case ONEWAY_ST_HOMOGENEITY:
- show_homogeneity();
- break;
- }
- }
- }
-
+ if ( stat_tables & STAT_HOMO )
+ show_homogeneity();
show_anova_table();
for ( v=0 ; v < n_vars ; ++v )
{
- char *s = (vars[v]->label) ? vars[v]->label : vars[v]->name;
- struct group_statistics *totals = &vars[v]->p.grp_data.ugs;
-
- const double df1 = vars[v]->p.grp_data.n_groups - 1;
- const double df2 = totals->n - vars[v]->p.grp_data.n_groups ;
+ double F;
+ const struct variable *var = vars[v];
+ const char *s = (var->label) ? var->label : var->name;
+ const struct group_statistics *totals = &var->p.grp_data.ugs;
+ const double df1 = var->p.grp_data.n_groups - 1;
+ const double df2 = totals->n - var->p.grp_data.n_groups ;
tab_text (t, 0, v + 1, TAB_LEFT | TAT_TITLE, s);
-
-
+ F = var->p.grp_data.levene;
+ tab_float (t, 1, v + 1, TAB_RIGHT, F, 8,3);
tab_float (t, 2, v + 1, TAB_RIGHT, df1 ,8,0);
tab_float (t, 3, v + 1, TAB_RIGHT, df2 ,8,0);
+
+ /* Now the significance */
+ tab_float (t, 4, v + 1, TAB_RIGHT,gsl_cdf_fdist_Q(F,df1,df2), 8, 3);
}
tab_submit (t);
struct casereader *r;
struct ccase c;
-
struct cmd_oneway *cmd = (struct cmd_oneway *) cmd_;
global_group_hash = hsh_create(4,
0,
(void *) indep_var->width );
- precalc(cmd);
+ precalc(cmd);
+
for(r = casefile_get_reader (cf);
casereader_read (r, &c) ;
postcalc(cmd);
- /*
- levene(cf, indep_var, n_vars, vars, LEV_LISTWISE, value_is_missing);
- */
+
+ if ( stat_tables & STAT_HOMO )
+ levene(cf, indep_var, n_vars, vars, LEV_LISTWISE, value_is_missing);
ostensible_number_of_groups = hsh_count (global_group_hash);
activity="create program"
cat > $TEMPDIR/out.stat <<EOF
-data list list /id * cables * price *.
-begin data.
-1 2.0 3.0
-2 1.0 2.0
-3 2.0 4.5
-4 2.0 4.5
-5 3.0 6.0
-end data.
-
-ONEWAY
- id cables BY price
- /STATISTICS descriptives homogeneity
- /MISSING analysis .
+DATA LIST LIST /quality * brand * .
+BEGIN DATA
+3 1
+2 1
+1 1
+1 1
+4 1
+5 2
+2 2
+4 2
+2 2
+3 2
+7 3
+4 3
+5 3
+3 3
+6 3
+END DATA
+
+VARIABLE LABELS brand 'Manufacturer'.
+VARIABLE LABELS quality 'Breaking Strain'.
+
+VALUE LABELS /brand 1 'Aspeger' 2 'Bloggs' 3 'Charlies'.
+
+ONEWAY
+ quality BY brand
+ /STATISTICS descriptives homogeneity
+ /CONTRASTS = -2 1 1
+ /CONTRASTS = 0 -1 1
+ .
EOF
if [ $? -ne 0 ] ; then no_result ; fi
$SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/out.stat
if [ $? -ne 0 ] ; then no_result ; fi
+diff $TEMPDIR/pspp.list - << EOF
+1.1 DATA LIST. Reading free-form data from the command file.
++--------+------+
+|Variable|Format|
+#========#======#
+|QUALITY |F8.0 |
+|BRAND |F8.0 |
++--------+------+
+
+2.1 ONEWAY. Test of Homogeneity of Variances
+#===============#================#===#===#============#
+# #Levene Statistic|df1|df2|Significance#
+#===============#================#===#===#============#
+#Breaking Strain# .092| 2| 12| .913#
+#===============#================#===#===#============#
+
+2.2 ONEWAY. ANOVA
+#==============================#==============#==#===========#=====#============#
+# #Sum of Squares|df|Mean Square| F |Significance#
+#===============#==============#==============#==#===========#=====#============#
+#Breaking Strain|Between Groups# 20.13| 2| 10.067|5.119| .025#
+# |Within Groups # 23.60|12| 1.967| | #
+# |Total # 43.73|14| | | #
+#===============#==============#==============#==#===========#=====#============#
+
+2.3 ONEWAY. Contrast Coefficients
+#==========#=======================#
+# # Manufacturer #
+# #-------+------+--------#
+# #Aspeger|Bloggs|Charlies#
+#========#=#=======#======#========#
+#Contrast|1# -2| 1| 1#
+# |2# 0| -1| 1#
+#========#=#=======#======#========#
+
+2.4 ONEWAY. Contrast Tests
+#===============================================#=================#==========#=====#=====#===============#
+# Contrast#Value of Contrast|Std. Error| t | df |Sig. (2-tailed)#
+#===============#======================#========#=================#==========#=====#=====#===============#
+#Breaking Strain|Assume equal variances| 1 # 3.80| 1.536|2.474| 12| .029#
+# | | 2 # 1.80| .887|2.029| 12| .065#
+# |Does not assume equal | 1 # 3.80| 1.483|2.562|8.740| .031#
+# | | 2 # 1.80| .917|1.964|7.720| .086#
+#===============#======================#========#=================#==========#=====#=====#===============#
+
+EOF
+if [ $? -ne 0 ] ; then fail ; fi
+
pass