Description Usage Arguments Details Value Author(s) References See Also Examples
This function is intended for users and sets up the left-hand side of the
factor analysis model and is a prerequisite for calling
make_restrictions
and Factanal
.
Although it is possible to simply estimate and use the unbiased sample
covariance matrix, there are many other ways to estimate a covariance
that can be superior, particularly when the traditional maximum likelihood
discrepancy function is not chosen in the call to make_restrictions
.
In technical terms, make_manifest
is the constructor for objects of
manifest-class
, which houses the sample covariance estimate
and some ancillary information in its slots. The three arguments in the signature
of the S4 generic function are:
x
, data
, and covmat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ## S4 method for signature 'missing,missing,list'
make_manifest(covmat, n.obs = NA_integer_, shrink = FALSE)
## S4 method for signature 'missing,missing,hetcor'
make_manifest(covmat, shrink = FALSE)
## S4 method for signature 'missing,missing,matrix'
make_manifest(covmat, n.obs = NA_integer_, shrink = FALSE, sds = NULL)
## S4 method for signature 'missing,missing,CovMcd'
make_manifest(covmat)
# Use the methods above when only the covariance matrix is available
# Use the methods below when the raw data are available (preferable)
## S4 method for signature 'data.frame,missing,missing'
make_manifest(x, subset, shrink = FALSE,
bootstrap = 0, how = "default", seed = 12345, wt = NULL, ...)
## S4 method for signature 'missing,data.frame,missing'
make_manifest(data, subset, shrink = FALSE,
bootstrap = 0, how = "default", seed = 12345, wt = NULL, ...)
## S4 method for signature 'missing,matrix,missing'
make_manifest(data, subset, shrink = FALSE,
bootstrap = 0, how = "default", seed = 12345, wt = NULL, ...)
## S4 method for signature 'matrix,missing,missing'
make_manifest(x, subset, shrink = FALSE,
bootstrap = 0, how = "default", seed = 12345, wt = NULL, ...)
## S4 method for signature 'formula,data.frame,missing'
make_manifest(x, data, subset, shrink = FALSE, na.action = "na.pass",
bootstrap = 0, how = "default", seed = 12345, wt = NULL, ...)
|
x |
a formula, data.frame, nonsquare matrix of observations by variables, or missing.
If a formula, then |
data |
a data.frame, nonsquare matrix of observations by variables, or missing. If a
data.frame and |
covmat |
A covariance matrix, a list, an object of
|
n.obs |
The number of observations, which is used if |
shrink |
A logical indicating whether to use a “shrinkage” estimator of
the covariance matrix. If |
sds |
Either |
subset |
A specification of the cases to be used |
bootstrap |
A nonnegative integer (defaulting to zero) indicating how many bootstraps to do when estimating the uncertainty of the sample covariance estimates. |
how |
A character string indicating how the covariance matrix should be estimated; see the Details section |
seed |
A vector of length at most one to be used as the random number generator
seed if |
wt |
An optional numeric vector of weights that is the same length as
the number of observations that indicates the weight for each observation when
|
na.action |
The |
... |
Further arguments that are passed to downstream functions when |
The rules governing the calculation of the sample covariance matrix are as follows and
primarily depend on whether any of the manifest variables are ordered factors. First,
consider the case where all manifest variables are numeric. If any of these manifest
variables contain missing values, then the covariance matrix is estimated via maximum
likelihood under multivariate normality assumptions but requires the suggested mvnmle
package. Otherwise, the how
argument dictates how the covariance matrix is estimated.
There is much to be said in favor the Minimum Covariance Determinant (CovMcd
)
estimator (see Pison et. al. 2003) and it is used as the default when there are no missing
data, although it can subtly affect the sampling distributions of estimates that subsequently
derived from it. The same could probably be said for the shrinkage estimators
(either via how = "lambda"
or shrink = TRUE
). The Dey and Srinivasan (1985)
shrinkage estimator preserves the eigenvectors of the preliminarily-calculated covariance
matrix but deterministically compresses the eigenvalues. The cov.shrink
estimator in the corpcor package is based on the idea that the amount shrinkage should be
proportional to the variance of the covariance estimates. Use how = "mle"
or
how = "unbiased"
to obtain either the maximum likelihood or unbiased sample covariance
estimator, the latter of which is the one used in virtually all factor applications whether
appropriate or not.
Next, consider the case where at least one manifest variable is an ordered factor. If
how = "ranks"
, Spearman correlations are estimated from the integer codes
underlying the ordered factors. This mechanism is recommended only if there are at least
five levels of each ordered factor and no missing data. In that case, one would presumably
want to specify method = "ADF"
in the subsequent call to make_restrictions
).
If how != "ranks"
all pairwise correlations are estimated under bivariate
normality assumptions via hetcor
in the suggested polycor package,
which will allow pairwise-deletion when there are missing data. If how != "ranks"
and
bootstrap > 0
(recommended), then there must not be any missing data because
the bootstrapping utilizes fast Spearman correlations and then tries to correct the bias
by rescaling the bootstrapped means to equal to point estimates calculated with the call
to hetcor
.
In general, bootstrapping is good for estimating the uncertainty of the estimated sample covariances and this uncertainty estimate is needed for the ADF discrepancy function and its special cases. In some cases, bootstrapping is the only way to obtain such an uncertainty estimate.
An object that inherits from manifest-class
.
Ben Goodrich
Dey, D. K. and Srinivasan K. (1985) Estimation of a covariance matrix under Stein's loss. The Annals of Statistics, 13, 1581–1591.
Pison, G., Rousseeuw, P.J., Filzmoser, P. and Croux, C. (2003) Robust factor analysis. Journal of Multivariate Analysis, 84, 145–172.
Factanal
, make_restrictions
, manifest-class
,
covMcd
, cov.wt
, hetcor
,
mlest
, cov.shrink
, and cov
.
1 2 3 4 | man <- make_manifest(covmat = Harman23.cor)
show(man) # some basic info
if(require(nFactors)) screeplot(man) # advanced Scree plot
cormat(man) # sample correlation matrix
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.