|
1 | 1 | #' Principal Component Analysis (PCA) and Factor Analysis (FA) |
2 | 2 | #' |
3 | | -#' The functions `principal_components()` and `factor_analysis()` can |
4 | | -#' be used to perform a principal component analysis (PCA) or a factor analysis |
5 | | -#' (FA). They return the loadings as a data frame, and various methods and |
6 | | -#' functions are available to access / display other information (see the |
7 | | -#' Details section). |
| 3 | +#' The functions `principal_components()` and `factor_analysis()` can be used to |
| 4 | +#' perform a principal component analysis (PCA) or a factor analysis (FA). They |
| 5 | +#' return the loadings as a data frame, and various methods and functions are |
| 6 | +#' available to access / display other information (see the 'Details' section). |
8 | 7 | #' |
9 | 8 | #' @param x A data frame or a statistical model. |
10 | 9 | #' @param n Number of components to extract. If `n="all"`, then `n` is set as |
|
26 | 25 | #' interpretability and avoids overfitting. Can be `TRUE` or `"robust"` (see |
27 | 26 | #' [`sparsepca::robspca()`]). |
28 | 27 | #' @param sort Sort the loadings. |
| 28 | +#' @param n_obs Number of observations in the original data set if `x` is a |
| 29 | +#' correlation matrix. Required to compute correct fit indices. |
| 30 | +#' @param n_matrix This argument expects a matrix where each cell `[i, j]` |
| 31 | +#' specifies the number of pairwise complete observations used to compute the |
| 32 | +#' correlation between variable `i` and variable `j` in the input `x`. It is |
| 33 | +#' crucial when `x` is a correlation matrix (rather than raw data), especially |
| 34 | +#' if that matrix was derived from a dataset containing missing values using |
| 35 | +#' pairwise deletion. Providing `n_matrix` allows `psych::fa()` to accurately |
| 36 | +#' calculate statistical measures, such as chi-square fit statistics, by |
| 37 | +#' accounting for the varying sample sizes that contribute to each individual |
| 38 | +#' correlation coefficient. This precision is vital for methods that rely on |
| 39 | +#' these specific sample sizes for statistical inference, such as 'minimum |
| 40 | +#' chi-square' (minchi) solutions. |
29 | 41 | #' @param threshold A value between 0 and 1 indicates which (absolute) values |
30 | 42 | #' from the loadings should be removed. An integer higher than 1 indicates the |
31 | 43 | #' n strongest loadings to retain. Can also be `"max"`, in which case it will |
|
0 commit comments