g_pca(G;S;XX;Z)
Returns a model corresponding to the principal component analysis of one or more variables.
Function type
Vector only
Syntax
g_pca(G;S;XX;Z)
Input
Argument | Type | Description |
---|---|---|
G |
any | A space- or comma-separated list of column names Rows are in the same group
if their values for all of the columns listed in If If any of the columns listed in |
S |
integer | The name of a column in which every row evaluates to a 1 or 0, which determines
whether or not that row is selected to be included in the calculation If
If any of the values in
|
XX |
integer or decimal | A space- or
comma-separated list of column names This denotes the data for the principal component analysis. |
Z |
text | A list of pairs of option names and option values specifying the method to be
used and/or method-specific parameters (optional)Z may
be:
|
Return Value
For every row in each group defined by G
(and for those rows where
S
=1, if specified), g_pca
carries
out a principal component analysis for the data in XX
and returns a special
type representing a model for each group in the data.
g_pca
returns can be used as an argument to:param(M;P;I)
to extract the eigenvalues and eigenvectors, orscore(XX;M;Z)
to return the principal components of the data set
M
is the column containing the result of g_pca
,
use the following function calls to obtain the desired information:score(XX;M;J)
J
th principal component ofXX
according to the PCA modelM
J
must be between 1 and the number of data columns.param(M;'evals';I)
I
th eigenvalue of the covariance/correlation matrixI
from PCA modelM
I
must be between 1 and the number of data columns.param(M;'evecs';J I)
I
th element of theJ
th eigenvector from PCA modelM
I
andJ
must each be between 1 and the number of data columns.param(M;'valcnt';)
- Count of valid observations (those where
XX
are all non-N/A) used in the analysis param(M;'center';J)
- Mean of the
J
th column ofXX
param(M;'scale';J)
- Standard deviation of the
J
th column ofXX
(if method iscorr
; returns 1.0 otherwise)