kva<-read.delim("kvadry.txt",dec=",",head=T) kva names(kva) head(kva) class(kva) summary(kva) install.packages("psych") library(psych) help(psych) # Hlavní komponenty pro.pc<-na.omit(kva[,5:16]) kva.pc<-princomp(pro.pc,cor=T) summary(kva.pc) # rozptyl kva.pc[1] kva.pc[2] kva.pc[3] kva.pc[4] kva.pc[5] kva.pc[6] kva.pc[7] loadings(kva.pc) # náboje plot(kva.pc,type="lines") # scree plot # PCA s VARIMAXem install.packages("GPArotation") library(GPArotation) ?principal kva.pc.var<-principal(pro.pc,nfactors=3,rotate="varimax") kva.pc.var # print results data() names(bfi) bfi.pro.pc<-na.omit(bfi[,1:25]) bfi.pc.var<-principal(bfi.pro.pc,nfactors=5,rotate="varimax") bfi.pc.var data() bf<-bfi head(bf) bf.pro.cfa<-na.omit(bf[,1:25]) install.packages("lavaan") library(lavaan) bf.model.lav <- ' agree =~ A1 + A2 + A3 + A4 + A5 consc =~ C1 + C2 + C3 + C4 + C5 extra =~ E1 + E2 + E3 + E4 + E5 neuro =~ N1 + N2 + N3 + N4 + N5 opene =~ O1 + O2 + O3 + O4 + O5 ' # specifikace modelu bf.cfa<-cfa(bf.model.lav,data=bf.pro.cfa) bf.cfa class(bf.cfa) summary(bf.cfa) summary(bf.cfa,fit.measures=T) fitMeasures(bf.cfa,fit.measures="all",baseline.model=NULL) summary(bf.cfa,standardized=T) modindices(bf.cfa)