Title: | Multiple Imputation for Exploratory Factor Analysis |
---|---|
Description: | Impute the covariance matrix of incomplete data so that factor analysis can be performed. Imputations are made using multiple imputation by Multivariate Imputation with Chained Equations (MICE) and combined with Rubin's rules. Parametric Fieller confidence intervals and nonparametric bootstrap confidence intervals can be obtained for the variance explained by different numbers of principal components. The method is described in Nassiri et al. (2018) <doi:10.3758/s13428-017-1013-4>. |
Authors: | Vahid Nassiri [aut],
Anikó Lovik [aut],
Geert Molenberghs [aut],
Geert Verbeke [aut],
Tobias Busch [aut, cre] |
Maintainer: | Tobias Busch <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.0 |
Built: | 2025-03-08 03:00:55 UTC |
Source: | https://github.com/teebusch/mifa |
Compute covariance matrix of incomplete data using multiple imputation. For multiple imputation, Multivariate Imputation by Chained Equations (MICE) from the mice package is used. The covariance matrices of the imputed data sets are combined using Rubin's rules.
mifa( data, cov_vars = dplyr::everything(), n_pc, ci = FALSE, conf = 0.95, n_boot = 1000, ... )
mifa( data, cov_vars = dplyr::everything(), n_pc, ci = FALSE, conf = 0.95, n_boot = 1000, ... )
data |
A data frame with missing values coded as |
cov_vars |
Variables in |
n_pc |
Integer or integer vector indicating number of principal components (eigenvectors) for which explained variance (eigenvalues) should be obtained and for which confidence intervals should be computed. Defaults to all principal components, i.e., the number of variables in the data. |
ci |
A character string indicating which types of confidence intervals
should be constructed for the variance explained by the principal
components. If |
conf |
Confidence level for constructing confidence intervals. The
default is |
n_boot |
Number of bootstrap samples to use for bootstrapped confidence intervals. The default is 1000. |
... |
Arguments passed on to
|
The function also computes the variance explained by different numbers of principal components and the corresponding Fieller (parametric) or bootstrap (nonparametric) confidence intervals.
A list:
The estimated covariance matrix of the incomplete data, based on the combined covariance matrices of imputed data sets.
A list containing the estimated covariance matrixes for all imputed data sets.
A data frame containing the estimated proportions of
explained variance for each of specified n_pc
components. Depending o
n ci
, it will also contain the estimated Fieller's (parametric) and/or
bootstrap (nonparametric) confidence interval for the proportion of
variance explained by the different numbers of principal components defined
by n_pc
.
Object of type mice::mids. This is the results of the multiple imputation step for the covariance matrix. Can be useful for diagnosing the multiple imputations.
Nassiri, V., Lovik, A., Molenberghs, G., & Verbeke, G. (2018). On using multiple imputation for exploratory factor analysis of incomplete data. Behavioral Research Methods 50, 501–517. doi:10.3758/s13428-017-1013-4
mifa_ci_boot()
, mifa_ci_fieller()
, mice::mice()
if(requireNamespace("psych")) { data <- psych::bfi mifa(data, cov_vars = -c(age, education, gender), ci = "fieller", print = FALSE) }
if(requireNamespace("psych")) { data <- psych::bfi mifa(data, cov_vars = -c(age, education, gender), ci = "fieller", print = FALSE) }
Compute bootstrap confidence intervals for the proportion of explained variance for the covariance of an incomplete data imputed using multiple imputation. For multiple imputation, Multivariate Imputation by Chained Equations (MICE) from the mice package is used.
mifa_ci_boot( data, cov_vars = dplyr::everything(), n_pc, conf = 0.95, n_boot = 1000, progress = FALSE, ... )
mifa_ci_boot( data, cov_vars = dplyr::everything(), n_pc, conf = 0.95, n_boot = 1000, progress = FALSE, ... )
data |
A data frame with missing values coded as |
cov_vars |
Variables in |
n_pc |
Integer or integer vector indicating number of principal components (eigenvectors) for which explained variance (eigenvalues) should be obtained and for which confidence intervals should be computed. Defaults to all principal components, i.e., the number of variables in the data. |
conf |
Confidence level for constructing confidence intervals. The
default is |
n_boot |
Number of bootstrap samples to use for bootstrapped confidence intervals. The default is 1000. |
progress |
Logical. Whether to show progress bars for computation of bootstrap confidence intervals. Default is FALSE. |
... |
Arguments passed on to
|
This function uses the Shao and Sitter (1996) method to combine multiple
imputation and bootstrapping. The imputations are done using mice::mice()
.
Normally, this function does not need to be called directly. Instead,
use mifa(..., ci = "boot")
.
A data frame containing bootstrapped confidence intervals for variance explained by different number of principal components.
Shao, J. & Sitter, R. R. (1996). Bootstrap for imputed survey data. Journal of the American Statistical Association 91.435 (1996): 1278-1288. doi:10.1080/01621459.1996.10476997
Other mifa confidence intervals:
mifa_ci_fieller()
if(requireNamespace("psych")) { data <- psych::bfi[, 1:25] mifa_ci_boot(data, n_pc = 3:8, n_boot = 10, print = FALSE) }
if(requireNamespace("psych")) { data <- psych::bfi[, 1:25] mifa_ci_boot(data, n_pc = 3:8, n_boot = 10, print = FALSE) }
Computes parametric confidence intervals for proportion of explained
variance for given numbers of principal components using Fieller's method.
Note that by setting ci = TRUE
in mifa()
, this confidence
interval can be computed as well.
mifa_ci_fieller(cov_imps, n_pc, conf = 0.95, N)
mifa_ci_fieller(cov_imps, n_pc, conf = 0.95, N)
cov_imps |
List containing the estimated covariance matrix within
each imputed data. One can use |
n_pc |
Integer or integer vector indicating number of principal components (eigenvectors) for which explained variance (eigenvalues) should be obtained and for which confidence intervals should be computed. Defaults to all principal components, i.e., the number of variables in the data. |
conf |
Confidence level for constructing confidence intervals. The
default is |
N |
A scalar specifying sample size. |
Normally, this function does not need to be called directly. Instead,
use mifa(..., ci = "fieller")
.
A data frame containing confidence intervals for n_pc
principal
components.
Fieller, E. C. (1954). Some problems in interval estimation. Journal of the Royal Statistical Society. Series B (Methodological): 175-185.
Other mifa confidence intervals:
mifa_ci_boot()
if(requireNamespace("psych")) { data <- psych::bfi[, 1:25] mi <- mifa(data, print = FALSE) mifa_ci_fieller(mi$cov_imputations, n_pc = 3:8, N = nrow(data)) }
if(requireNamespace("psych")) { data <- psych::bfi[, 1:25] mi <- mifa(data, print = FALSE) mifa_ci_fieller(mi$cov_imputations, n_pc = 3:8, N = nrow(data)) }