Created
November 5, 2019 22:27
-
-
Save mhoangvslev/03589883d6681a0bf052f3e8d06f26e1 to your computer and use it in GitHub Desktop.
Contribution des invidivus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Individus | |
## Contribution relative | |
result$ind$qlt <- matrix(unlist(lapply(1:nbIndv, function(indv){ | |
(result$ind$coords[indv, ]**2) / sum(result$ind$coords[indv, ]**2) | |
})), nrow = nbIndv, ncol = nbComps, byrow = TRUE); | |
colnames(result$ind$qlt) <- colnames(result$ind$qlt, do.NULL = FALSE, prefix = "Comp. "); | |
## Contribution absolue | |
result$ind$ctr <- matrix(unlist(lapply(1:nbComps, function(axe){ | |
result$ind$coords[, axe]**2 / (nbIndv * eigenvalues[axe]) | |
})), nrow = nbIndv, ncol = nbComps); | |
colnames(result$ind$ctr) <- colnames(result$ind$ctr, do.NULL = FALSE, prefix = "Comp. "); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment