Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mat_orig <- matrix(c(
- 1, 1, 1, 0, 0,
- 0, 4, 8, 5, 0,
- 0, 0, 0, 3, 4
- ), ncol = 3)
- colnames(mat_orig) <- c('[5,10[','[10,15[','[15,20]')
- rownames(mat_orig) <- c('[0,4[','[4,8[','[8,12[','[12,16[','[16,20[')
- mat_orig
- mat_fi <- matrix(c(
- 0.888888889, 0.088888889, 0, -0.111111111, -0.111111111,
- -0.62962963, 0.17037037, 0.259259259, -0.00462963, -0.62962963,
- -0.259259259, -0.259259259, -0.259259259, 0.115740741, 0.740740741
- ), ncol = 3)
- mat_fi
- mat_mp <- matrix(c(
- 9.00000, 0, 0,
- 0, 1.58824, 0,
- 0, 0, 3.85714
- ), ncol=3)
- mat_mp
- mat_mn <- matrix(c(
- 27.0000, 0, 0, 0, 0,
- 0, 5.4000, 0, 0, 0,
- 0, 0, 3.0000, 0, 0,
- 0, 0, 0, 3.3750, 0,
- 0, 0, 0, 0, 6.7500
- ), ncol=5)
- mat_mn
- res_col <- eigen(mat_mp %*% t(mat_fi) %*% solve(mat_mn) %*% mat_fi)
- res_col
- comp_col <- matrix(c(
- mat_fi %*% matrix(res_col$vectors[,1], ncol=1) * -2.0897 ,
- mat_fi %*% matrix(res_col$vectors[,2], ncol=1) * 4.75
- ), ncol=2)
- comp_col
- library(FactoMineR)
- test_ca <- CA(mat_orig)
- comp_col
- test_ca$row$coord
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement