1. Home
  2. VTABLE procedure

VTABLE procedure

Forms a variate and set of classifying factors from a table (P.W. Goedhart).

No options

Parameters

TABLE = tables Tables to be copied
VARIATE = variates New variate to contain the body of each table
CLASSIFICATION = pointers Pointer containing the factors by which each new variate is classified
LABELS = texts Labels for the new variate, indicating the values of the classifying factors corresponding to each of its units

Description

This procedure can be used to store the body of a table in a variate and obtain a set of factors to represent the way in which the data are arranged in the table. These factors then classify the newly formed variate in the same way as in the table. You can also form a text containing labels formed from the values of the classifying factors. Margins of the table are ignored.

The table to be copied is specified by the TABLE parameter, the variate must be specified by the VARIATE parameter, the set of classifying factors can be obtained by setting CLASSIFICATION to a pointer, and the labels by setting the LABELS parameter to a text. If the CLASSIFICATION pointer has not been declared, the names of the classifying factors of the table are used as suffix names. The newly formed factors have the same attributes as the old classifying factors, excluding the setting of EXTRA. Note that the order in which the factors are obtained can be unexpected for implicitly declared tables as explained in the Guide to Genstat, Part 1, Section 4.1.5.

Options: none.

Parameters: TABLE, VARIATE, CLASSIFICATION, LABELS.

Method

Margins of the table are deleted by the directive MARGIN. The classifying factors of the table are obtained with GETATTRIBUTE. The initial declarations of the new factors are done by DUPLICATE to transfer any relevant attributes. Factor values are then produced by GENERATE.

See also

Procedure: FBETWEENGROUPVECTORS, VMATRIX.

Commands for: Calculations and manipulation.

Example

CAPTION 'VTABLE example',!t(\ 
        'In a randomized block experiment with 4 blocks of 3 units each,',\ 
        'the effect of 3 different diets on milk production was tested.',\  
        'Each unit consisted of 4 or 5 cows; milk production was measured',\ 
        'individually. VTABLE is used to preprocess the data for an',\ 
        'analysis of variance.'); STYLE=meta,plain
FACTOR  [LEVELS=4 ; VALUES=12(1),15(2),13(3),14(4)] Block
FACTOR  [LABELS=!T('Nitrogen+','Nitrogen0','Nitrogen-') ;\ 
        VALUES=4(1,2,3), 5(1,2,3), 4(1,2,3),3, 5(1,2),4(3)] Diet
VARIATE [NVALUES=54] Milk
READ    Milk; DECIMALS=1
   312 330 300 287        294 291 303 289        275 282 281 290
   278 284 281 263 289    294 283 281 274 298    264 270 288 285 248
   290 256 265 243        270 261 256 279        253 259 268 240 242
   276 243 233 238 259    245 241 227 255 222    235 227 227 247 :
TABULATE [CLASSIFICATION=Block,Diet] Milk ; MEAN=TabMilk
PRINT    TabMilk; DECIMALS=1
VTABLE   TABLE=TabMilk; VARIATE=MeanMilk;\ 
         CLASSIFICATION=!P(MeanBlock, MeanDiet)
PRINT    MeanMilk,MeanBlock,MeanDiet; DECIMALS=1,2(*)
BLOCK    MeanBlock
TREAT    MeanDiet
ANOVA    MeanMilk
Updated on March 4, 2019

Was this article helpful?