Forms the values of
|Printed output required (
||Variate of weights for weighted SSP, or symmetric matrix of weights (one row and column for each unit of data); default
||Used for sequential formation of SSPMs; a positive value indicates that formation is not yet complete (see
|SSPMs||Structures to be formed|
FSSPM forms the values for the component parts of SSPM structures, based on the information supplied when the
SSPM directive was used to declare them. You can use an SSPM as input to the regression directive
TERMS, or the multivariate directives
CVA. The method used to form the
SSPM is based on the updating formula for the means and corresponding corrected sums of squares and cross products (Herraman 1968).
FSSPM has one parameter which lists the SSPM structures whose values are to be formed. If any of these vectors has a missing value, the corresponding unit is excluded from all the means and all the sums of squares and products. You can also exclude units by setting their weights to zero.
When you have very many units, you may not be able to store them all at the same time within Genstat. You can then use the
SEQUENTIAL option of
READ to read the data in conveniently sized blocks, and the
SEQUENTIAL option of
FSSPM to control the accumulation of the sums of squares and products. The SSPM is updated for each block of data in turn until the end of data is found. The
READ sets the scalar indicator to a negative value.
FSSTM takes account of restrictions on any of the variates or factors forming the terms of the SSPM, or on the weights variate or grouping factor if you have specified them.
Herraman, C. (1968). Algorithm AS12: Sums of squares and products matrix. Applied Statistics, 17, 289-292.
" Example FSSP-1: formation of sums of squares and products Form sums of squares and products of data from an industrial plant: 1. Monthly water usage (thousand gallons) 2. Average monthly temperature (degrees F) 3. Amount of production (billion pounds) 4. Number of plant operating days in the month 5. Number of people employed (Data from Draper and Smith, Regression Analysis (1981) p353.)" " The data from 17 months are in the file 'FSSP-1.DAT'." FILEREAD [NAME='%gendir%/examples/FSSP-1.DAT'; IMETHOD=read] FGROUPS=no " Form the sums of squares and products and means of all five variates. " SSPM [TERMS=Water,Temp,Product,Opdays,Employ] sspplant FSSPM [PRINT=sspm,correlation] sspplant " The SSPM structure is just a pointer to a triangular matrix of squares and products, a variate of means, and a scalar storing the number of units. The constituent structures can be referred to using the suffix notation." PRINT sspplant['Sums'] & sspplant['Means'] " Form the correlation matrix from the sums of squares and products." CALCULATE corplant = CORRMAT(sspplant['Sums']) PRINT corplant " The SSPM structure can be used in many multivariate directives; for example, for principal components analysis." PCP [PRINT=roots,scores] sspplant " Regression analysis can also be based on an SSPM structure; however, accuracy can be poor on some computers because the SSPM values are stored in single precision, whereas regression calculations are usually done in double precision. Genstat prints a warning if that is the case; example SSPM(2) shows how to avoid this using the SAVE option of FSSPM." MODEL Water TERMS [SSPM=sspplant] FIT Temp,Product,Opdays,Employ