spir<-read,table("spir,txt",head=T) library(psych) names(spir) pc<-princomp(spir[,5:28],cor=T) plot(pc,type="lines") pc<-principal(spir[,5:28],nfactors=4,rotate="varimax") library(sem) sp.c<-cov(spir[,5:28]) mod.sp<-specifyModel() cog->s1_cog, fc1, NA ewb->ex1, fe2, NA rel->s2_rel, fr3, NA cog->s3_cog, fc4, NA ewb->ex2, fe5, NA rel->s4_rel, fr6, NA cog->s5_cog, fc7, NA ewb->ex3, fe8, NA rel->s6_rel, fr9, NA cog->s7_cog, fc10, NA ewb->ex4, fe11, NA rel->s8_rel, fr12, NA cog->s9_cog, fc13, NA ewb->ex5, fe14, NA rel->s10_rel, fr15, NA cog->s11_cog, fc16, NA ewb->ex6, fe17, NA rel->s12_rel, fr18, NA que->s13_q, fq19, NA que->s14_q, fq20, NA que->s15_q, fq21, NA que->s16_q, fq22, NA que->s17_q, fq23, NA que->s18_q, fq24, NA cog<->cog, NA, 1 ewb<->ewb, NA, 1 rel<->rel, NA, 1 que<->que, NA, 1 cog<->rel, cf1, NA cog<->que, cf2, NA rel<->que, cf3, NA # cog<->ewb, cf4, NA # ewb<->rel, NA, 1 # ewb<->que, NA, 1 sp.fit<-sem(mod.sp,sp.c,nrow(spir)) summary(sp.fit) stdCoef(sp.fit) summary(sp.fit,fit.indices=c("GFI", "AGFI", "RMSEA", "NFI", "NNFI", "CFI", "RNI", "IFI", "SRMR", "AIC", "AICc", "BIC", "CAIC")) modIndices(sp.fit) # provést modifikaci modelu