Confirmatory Factor Analysis
Confirmatory Factor Analysis
Example usage
Arguments
data | the data as a data frame |
factors | a list containing named lists that define the label of the factor and the vars that belong to that factor |
resCov | a list of lists specifying the residual covariances that need to be estimated |
miss | 'listwise' or 'fiml', how to handle missing values; 'listwise' excludes a row from all analyses if one of its entries is missing, 'fiml' uses a full information maximum likelihood method to estimate the model. |
constrain | 'facVar' or 'facInd', how to contrain the model; 'facVar' fixes the factor variances to one, 'facInd' fixes each factor to the scale of its first indicator. |
estTest | TRUE (default) or FALSE, provide 'Z' and 'p' values for the model estimates |
ci | TRUE or FALSE (default), provide a confidence interval for the model estimates |
ciWidth | a number between 50 and 99.9 (default: 95) specifying the confidence interval width that is used as 'ci' |
stdEst | TRUE or FALSE (default), provide a standardized estimate for the model estimates |
factCovEst | TRUE (default) or FALSE, provide estimates for the factor (co)variances |
factInterceptEst | TRUE or FALSE (default), provide estimates for the factor intercepts |
resCovEst | TRUE (default) or FALSE, provide estimates for the residual (co)variances |
resInterceptEst | TRUE or FALSE (default), provide estimates for the residual intercepts |
fitMeasures | one or more of 'cfi', 'tli', 'srmr', 'rmsea', 'aic', or 'bic'; use CFI, TLI, SRMR, RMSEA + 90% confidence interval, adjusted AIC, and BIC model fit measures, respectively |
modelTest | TRUE (default) or FALSE, provide a chi-square test for exact fit that compares the model with the perfect fitting model |
pathDiagram | TRUE or FALSE (default), provide a path diagram of the model |
corRes | TRUE or FALSE (default), provide the residuals for the observed correlation matrix (i.e., the difference between the expected correlation matrix and the observed correlation matrix) |
hlCorRes | a number (default: 0.1), highlight values in the 'corRes' table above this value |
mi | TRUE or FALSE (default), provide modification indices for the parameters not included in the model |
hlMI | a number (default: 3), highlight values in the 'modIndices' tables above this value |
Returns
A results object containing:
results$factorLoadings | a table |
results$factorEst$factorCov | a table |
results$factorEst$factorIntercept | a table |
results$resEst$resCov | a table |
results$resEst$resIntercept | a table |
results$modelFit$test | a table |
results$modelFit$fitMeasures | a table |
results$modelPerformance$corRes | a table |
results$modelPerformance$modIndices | |
results$pathDiagram | an image |
results$modelSyntax |
Tables can be converted to data frames with asDF or as.data.frame(). For example:
results$factorLoadings$asDF
as.data.frame(results$factorLoadings)