library(psych) install.packages("psych") library(sem) ls() data(bfi) head(bfi) bfi[1:5,1:2] bfi[,1:25] # výběr dat BF.upr<-na.omit(bfi[,1:25]) # vynechání chybějících hodnot BF.c<-cov(BF.upr) model.bfi<-specifyModel() agree->A1, fa1, NA agree->A2, fa2, NA agree->A3, fa3, NA agree->A4, fa4, NA agree->A5, fa5, NA consc->C1, fc1, NA consc->C2, fc2, NA consc->C3, fc3, NA consc->C4, fc4, NA consc->C5, fc5, NA extra->E1, fe1, NA extra->E2, fe2, NA extra->E3, fe3, NA extra->E4, fe4, NA extra->E5, fe5, NA neuro->N1, fn1, NA neuro->N2, fn2, NA neuro->N3, fn3, NA neuro->N4, fn4, NA neuro->N5, fn5, NA opene->O1, fo1, NA opene->O2, fo2, NA opene->O3, fo3, NA opene->O4, fo4, NA opene->O5, fo5, NA agree<->agree, NA, 1 consc<->consc, NA, 1 extra<->extra, NA, 1 neuro<->neuro, NA, 1 opene<->opene, NA, 1 BF.fit<-sem(model.bfi,BF.c,nrow(BF.upr)) summary(BF.fit) stdCoef(BF.fit) summary(BF.fit,fit.indices=c("GFI", "AGFI", "RMSEA", "NFI", "NNFI", "CFI", "RNI", "IFI", "SRMR", "AIC", "AICc", "BIC", "CAIC")) modIndices(BF.fit) # provést modifikaci modelu