Forms variates and classifying factors containing within-group summaries to use e.g. in a between-group analysis (R.W. Payne).
||Factors defining the groups; must be set|
||Saves a variate counting the number of units with each factor combination; default
||Weights to be used to calculate the within-group summaries; default
||How to summarize the data variates (
||Percentage point for quantiles; default 50|
||Whether to omit units arising from empty cells in the summary table (
||Whether to redefine the levels of factors (
||Original data vectors|
||New vectors containing the within-group summaries|
FBETWEENGROUPVECTORS is useful when you have replicated observations on a set of groups. It allows you to form variates, with a unit for each group, containing a summary of the observations within that group. You can also form factors, again with a unit for each group, to define the characteristics of the groups. You can then use these to perform a between-group analysis, with one of the variates acting as the response variate, and the factors and other variates defining the model to be fitted.
The factors defining the groups are specified by the
CLASSIFICATION option. The
METHOD option specifies how to form summaries of the variates, and you can specify weights by using the
WEIGHTS option. For more information about the summaries, see the
TABULATE directive, which is used to do the calculations. Factors are summarized by taking the level that occurs most frequently within each group, using the
PERCENTQUANTILES option specifies the percentage point to use for quantiles. The default is 50 (i.e. the median).
OMITEMPTYCELLS option indicates whether to omit units arising from empty cells in the summary table. By default, these are included.
SETLEVELS option allows you to redefine the levels of the new factors, to exclude any that do not occur in the data set. By default, they are not redefined.
VECTOR parameter specifies the variates and factors to be summarized, and the
NEWVECTOR parameter saves the variates and factors containing the summaries. You can also use the
COUNTS to save a variate containing counts of the number of units in each group if
WEIGHTS is unset, or the sum of their weights if it is set.
VECTOR, or the
WEIGHTS variate, or any of the classifying factors is restricted, the summaries will be form using only the restricted subset of units. If more than one variate or factor is restricted, the restrictions must be the same.
CAPTION 'FBETWEENGROUPVECTORS example'; STYLE=meta SPLOAD '%gendir%/data/oats.gsh' CALCULATE yield = (yield * 80) / (112 * 4) " use FBETWEENGROUPVECTORS to do the between whole-plot analysis of the split plot design in the Guide to Genstat, Part 2, Section 4.2.1 " FBETWEENGROUPVECTORS [CLASSIFICATION=blocks,wplots; COUNTS=plotreps;\ METHOD=mean] blocks,wplots,nitrogen,variety,yield;\ NEWVECTOR=Blocks,Wplots,Nitrogen,Variety,Yield TREATMENTS Variety BLOCK Blocks ANOVA [PRINT=aovtable; WEIGHTS=plotreps] Yield " compare with ordinary ANOVA (the results are the same because the design is orthogonal) " TREATMENTS variety*nitrogen BLOCK blocks/wplots/subplots ANOVA [PRINT=aovtable] yield