1. Home
  2. FSSPM directive

FSSPM directive

Forms the values of SSPM structures.

Options

PRINT = string tokens Printed output required (correlations, wmeans, SSPM); default * i.e. no printing
WEIGHTS = variate or symmetric matrix Variate of weights for weighted SSP, or symmetric matrix of weights (one row and column for each unit of data); default * i.e. all units with weight one
SEQUENTIAL = scalar Used for sequential formation of SSPMs; a positive value indicates that formation is not yet complete (see READ directive); default * i.e. not sequential

Parameter

    SSPMs Structures to be formed

Description

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 PCP and 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 PRINT option has no effect until the last set of values is processed, when READ sets the scalar indicator to a negative value.

Options: PRINT, WEIGHTS, SEQUENTIAL.

Parameter: unnamed.

Action with RESTRICT

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.

Reference

Herraman, C. (1968). Algorithm AS12: Sums of squares and products matrix. Applied Statistics, 17, 289-292.

See also

Directives: SSPM, CVA, FCA, PCO, PCP, TERMS.

Procedures: FCORRELATION, FVCOVARIANCE, ROBSSPM.

Commands for: Calculations and manipulation, Multivariate and cluster analysis,

Regression analysis.

Example

" 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
Updated on March 7, 2019

Was this article helpful?