la base de datos que se trabaja se puede descargar en este link
#paquetes que se necesitan.
ipak <- function(pkg){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg))
install.packages(new.pkg, dependencies = TRUE)
sapply(pkg, require, character.only = TRUE)
}
# usage
packages <- c("parameters","apa","haven","ggplot2","ggpubr",
"gridExtra","apaTables", "reshape", "GPArotation", "mvtnorm", "psych", "psychometric", "lavaan", "nFactors", "semPlot", "lavaan", "MVN", "semTools")
ipak(packages)
## Loading required package: parameters
## Warning: package 'parameters' was built under R version 4.0.5
## Loading required package: apa
## Warning: package 'apa' was built under R version 4.0.5
## Loading required package: haven
## Loading required package: ggplot2
## Loading required package: ggpubr
## Warning: package 'ggpubr' was built under R version 4.0.3
## Loading required package: gridExtra
## Loading required package: apaTables
## Warning: package 'apaTables' was built under R version 4.0.5
## Loading required package: reshape
## Loading required package: GPArotation
## Warning: package 'GPArotation' was built under R version 4.0.3
## Loading required package: mvtnorm
## Loading required package: psych
##
## Attaching package: 'psych'
## The following objects are masked from 'package:ggplot2':
##
## %+%, alpha
## Loading required package: psychometric
## Warning: package 'psychometric' was built under R version 4.0.5
## Loading required package: multilevel
## Warning: package 'multilevel' was built under R version 4.0.5
## Loading required package: nlme
## Loading required package: MASS
##
## Attaching package: 'psychometric'
## The following object is masked from 'package:psych':
##
## alpha
## The following object is masked from 'package:ggplot2':
##
## alpha
## Loading required package: lavaan
## This is lavaan 0.6-7
## lavaan is BETA software! Please report any bugs.
##
## Attaching package: 'lavaan'
## The following object is masked from 'package:psych':
##
## cor2cov
## Loading required package: nFactors
## Warning: package 'nFactors' was built under R version 4.0.5
## Loading required package: lattice
##
## Attaching package: 'nFactors'
## The following object is masked from 'package:lattice':
##
## parallel
## Loading required package: semPlot
## Warning: package 'semPlot' was built under R version 4.0.5
## Registered S3 methods overwritten by 'lme4':
## method from
## cooks.distance.influence.merMod car
## influence.merMod car
## dfbeta.influence.merMod car
## dfbetas.influence.merMod car
## Loading required package: MVN
## Warning: package 'MVN' was built under R version 4.0.3
## Registered S3 method overwritten by 'GGally':
## method from
## +.gg ggplot2
## sROC 0.1-2 loaded
## Loading required package: semTools
##
## ###############################################################################
## This is semTools 0.5-3
## All users of R (or SEM) are invited to submit functions or ideas for functions.
## ###############################################################################
##
## Attaching package: 'semTools'
## The following object is masked from 'package:psych':
##
## skew
## The following object is masked from 'package:parameters':
##
## kurtosis
## parameters apa haven ggplot2 ggpubr gridExtra
## TRUE TRUE TRUE TRUE TRUE TRUE
## apaTables reshape GPArotation mvtnorm psych psychometric
## TRUE TRUE TRUE TRUE TRUE TRUE
## lavaan nFactors semPlot lavaan MVN semTools
## TRUE TRUE TRUE TRUE TRUE TRUE
library(haven)
DFEFA <- read_sav("E:/DFEFA.sav")
View(DFEFA)
#n factors ASI
results_nfactorASI<-n_factors(DFEFA[,1:12], rotate = "varimax", fm = "mle", n = NULL)
plot(results_nfactorASI)
results_nfactorASI
as.data.frame(results_nfactorASI)
summary(results_nfactorASI)
#Exploratory Factorial ANalysis ASI
ASIfactor<-fa(DFEFA[,1:12],nfactors = 2,fm = "ml",rotate ="varimax",cor = "poly")
print(ASIfactor,digits = 2,cut = .30,sort=TRUE)
## Factor Analysis using method = ml
## Call: fa(r = DFEFA[, 1:12], nfactors = 2, rotate = "varimax", fm = "ml",
## cor = "poly")
## Standardized loadings (pattern matrix) based upon correlation matrix
## item ML1 ML2 h2 u2 com
## ASI9 9 0.89 0.83 0.17 1.1
## ASI10 10 0.79 0.67 0.33 1.2
## ASI8 8 0.72 0.57 0.43 1.2
## ASI11 11 0.69 0.53 0.47 1.2
## ASI12 12 0.63 0.44 0.56 1.2
## ASI7 7 0.52 0.35 0.65 1.5
## ASI3 3 0.75 0.58 0.42 1.1
## ASI4 4 0.74 0.57 0.43 1.1
## ASI2 2 0.33 0.66 0.54 0.46 1.5
## ASI1 1 0.65 0.46 0.54 1.1
## ASI5 5 0.62 0.42 0.58 1.2
## ASI6 6 0.32 0.50 0.35 0.65 1.7
##
## ML1 ML2
## SS loadings 3.40 2.89
## Proportion Var 0.28 0.24
## Cumulative Var 0.28 0.52
## Proportion Explained 0.54 0.46
## Cumulative Proportion 0.54 1.00
##
## Mean item complexity = 1.2
## Test of the hypothesis that 2 factors are sufficient.
##
## The degrees of freedom for the null model are 66 and the objective function was 6.06 with Chi Square of 2710.06
## The degrees of freedom for the model are 43 and the objective function was 0.66
##
## The root mean square of the residuals (RMSR) is 0.04
## The df corrected root mean square of the residuals is 0.06
##
## The harmonic number of observations is 452 with the empirical chi square 120.36 with prob < 3e-09
## The total number of observations was 453 with Likelihood Chi Square = 296.31 with prob < 1.5e-39
##
## Tucker Lewis Index of factoring reliability = 0.852
## RMSEA index = 0.114 and the 90 % confidence intervals are 0.102 0.127
## BIC = 33.33
## Fit based upon off diagonal values = 0.99
## Measures of factor score adequacy
## ML1 ML2
## Correlation of (regression) scores with factors 0.94 0.90
## Multiple R square of scores with factors 0.89 0.82
## Minimum correlation of possible factor scores 0.78 0.64