if(require(psychTools)) {
lowerMat(Thurstone)
lb <- lowerCor(bfi[1:10]) #finds and prints the lower correlation matrix,
# returns the square matrix.
lowerCor(psychTools::ability[,1:5]) #the Pearson correlations, compare with
lowerCor(psychTools::ability[,1:5],cor="tetra")
#fiml <- corFiml(bfi[1:10]) #FIML correlations require lavaan package
#lowerMat(fiml) #to get pretty output
f3 <- fa(Thurstone,3)
f3r <- reflect(f3,2) #reflect the second factor
#find the complexity of the response patterns of the iqitems.
round(shannon(psychTools::iqitems),2)
#test.all('BinNor') #Does the BinNor package work when we are using other packages
bestItems(lb,"A3",cut=.1,dictionary=bfi.dictionary[1:2])
#to make this a latex table
#df2latex(bestItems(lb,2,cut=.2))
}
data(bfi.dictionary)
f2 <- fa(bfi[1:10],2)
fa.lookup(f2,bfi.dictionary)
sa1 <-sat.act[1:2]
sa2 <- sat.act[3:4]
sa3 <- sat.act[5:6]
cor2(sa1,sa2)
cor2(list(sa1,sa2)) #show within set and between set cors
cor2(list(sa1,sa2,sa3))
lowerCor(fromTo(sat.act,"ACT","SATQ")) #show some correlations
vect <- cs(ACT,SATQ) #skip the quotes
vect #they are in this vector
#to combine longer terms
vect <- cs("Here is a longish",vector, that, we ,"want to combine", into, several)
vect
temp <- acs("Here is a longish",vector, that, we ,"want to combine", into, one)
temp
lowerCor(fromTo(sat.act,cs(ACT,SATQ)))
lowerCor(fromTo(bfi,cs(A3,C4)),cor="poly") #compare with
lowerCor(fromTo(bfi,cs(A3,C4)))
set.seed(42)
temp <- SAPAfy(bfi[1:10],3) #30 percent sample from bfi
f2 <- fa(bfi[1:10],2)
f2s <- fa(temp,2,missing=TRUE)
fa.congruence(f2s,f2) #the two factor structure are almost identical
#although the scores are not identical
cor2(f2$scores, f2s$scores)
Run the code above in your browser using DataLab