cat("\nExample 1:\nEmpirical Target Matrix:\n")
# Mansolf and Reise Table 2 Example
Btrue <- matrix(c(.48, .40, 0, 0, 0,
.51, .35, 0, 0, 0,
.67, .62, 0, 0, 0,
.34, .55, 0, 0, 0,
.44, 0, .45, 0, 0,
.40, 0, .48, 0, 0,
.32, 0, .70, 0, 0,
.45, 0, .54, 0, 0,
.55, 0, 0, .43, 0,
.33, 0, 0, .33, 0,
.52, 0, 0, .51, 0,
.35, 0, 0, .69, 0,
.32, 0, 0, 0, .65,
.66, 0, 0, 0, .51,
.68, 0, 0, 0, .39,
.32, 0, 0, 0, .56), 16, 5, byrow=TRUE)
Rex1 <- Btrue %*% t(Btrue)
diag(Rex1) <- 1
out.ex1 <- BiFAD(R = Rex1,
B = NULL,
numFactors = 4,
facMethod = "fals",
rotate = "oblimin",
salient = .25)
cat("\nRank Deficient Bifactor Solution:\n")
print( round(out.ex1$BstarSL, 2) )
cat("\nFull Rank Bifactor Solution:\n")
print( round(out.ex1$BstarFR, 2) )
cat("\nExample 2:\nUser Defined Target Matrix:\n")
Bpattern <- matrix(c( 1, 1, 0, 0, 0,
1, 1, 0, 0, 0,
1, 1, 0, 0, 0,
1, 1, 0, 0, 0,
1, 0, 1, 0, 0,
1, 0, 1, 0, 0,
1, 0, 1, 0, 0,
1, 0, 1, 0, 0,
1, 0, 0, 1, 0,
1, 0, 0, 1, 0,
1, 0, 0, 1, 0,
1, 0, 0, 1, 0,
1, 0, 0, 0, 1,
1, 0, 0, 0, 1,
1, 0, 0, 0, 1,
1, 0, 0, 0, 1), 16, 5, byrow=TRUE)
out.ex2 <- BiFAD(R = Rex1,
B = Bpattern,
numFactors = NULL,
facMethod = "fals",
rotate = "oblimin",
salient = .25)
cat("\nRank Deficient Bifactor Solution:\n")
print( round(out.ex2$BstarSL, 2) )
cat("\nFull Rank Bifactor Solution:\n")
print( round(out.ex2$BstarFR, 2) )
Run the code above in your browser using DataLab