View source: R/principalcomponentsanalysis.R
PrincipalComponentsAnalysis | R Documentation |
PrincipalComponentsAnalysis
Calculate a Principal Component Analysis
PrincipalComponentsAnalysis(
data,
weights = NULL,
subset = NULL,
missing = "Exclude cases with missing data",
use.correlation = TRUE,
rotation = "none",
oblimin.delta = 0,
promax.kappa = 4,
select.n.rule = "Number of factors",
eigen.min = 1,
n.factors = 2,
sort.coefficients.by.size = FALSE,
suppress.small.coefficients = FALSE,
min.display.loading.value = 0.1,
print.type = "loadings",
show.labels = TRUE,
plot.labels = TRUE,
data.groups = NULL,
tol = 1e-13,
use.combined.scatter = FALSE
)
## S3 method for class 'flipFactorAnalysis'
fitted(object, ...)
data |
A data frame with numeric columns which contains the data to be analyzed. |
weights |
A numeric vector containing the weight for each case in data. |
subset |
A logical vector which describes the subset of |
missing |
A string specifiying what to do when the |
use.correlation |
A logical value specifying whether to use the
correlation matrix ( |
rotation |
A string specifying the type of rotation to be used. Valid
options are |
oblimin.delta |
A parameter supplied for oblimin rotations. |
promax.kappa |
A parameter supplied for promax rotations. |
select.n.rule |
Method for selecting the number of principal components to keep. May be one of |
eigen.min |
Cut-off above which eigenvalues are selected. Used if |
n.factors |
An integer specifying the number of principal components to keep. Used if |
sort.coefficients.by.size |
A logical value determining whether loadings should be sorted when printed. |
suppress.small.coefficients |
A logical value specifying whether components
that are less than |
min.display.loading.value |
Loadings smaller than this value will not be displayed when printed. |
print.type |
A string specifying the type of printing that should be
done. Valid options are |
show.labels |
If |
plot.labels |
A logical value which determines whether or not the scatter plot will show the labels of the input data, or just integers specifying the column number of each variable. |
data.groups |
A |
tol |
When the correlation martrix (or covariance) matrix has any singular values below this number
the analysis will stop. Note that the function |
object |
Object of class |
use.combined.scatter |
Draw scatterplots using rhtmlCombinedScatter. |
... |
Not used. |
This uses principal
from package psych
to compute the unrotated
PCA, and uses package GPArotation
to find a rotated solution if required, to match SPSS' PCA. The
rotation includes a Kaiser normalization and a method of Promax which matches what SPSS does.
Components with large negative loadings will have signs flipped to give positive components after rotation.
Includes handling of missing data, weighting, and filtering.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.