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)Jth principal component ofXXaccording to the PCA modelMJmust be between 1 and the number of data columns.param(M;'evals';I)Ith eigenvalue of the covariance/correlation matrixIfrom PCA modelMImust be between 1 and the number of data columns.param(M;'evecs';J I)Ith element of theJth eigenvector from PCA modelMIandJmust each be between 1 and the number of data columns.param(M;'valcnt';)- Count of valid observations (those where
XXare all non-N/A) used in the analysis param(M;'center';J)- Mean of the
Jth column ofXX param(M;'scale';J)- Standard deviation of the
Jth column ofXX(if method iscorr; returns 1.0 otherwise)
