Existe-t-il un meilleur moyen de parcourir un ensemble de paramètres d'un ensemble de données donné? Évidemment, j'essaie d'obtenir une table de coefficients de corrélation: les colonnes sont "CI, CVP, moyenne PAP, moyenne SAP", les lignes sont "ALAT, ASAT, GGT, Bili, LDH, FBG". Pour chaque combinaison, j'aimerais obtenir le coefficient de corrélation et le niveau de signification (p = ...). Ci-dessous Vous voyez "la voie difficile". Mais existe-t-il un moyen plus élégant, éventuellement avec une table imprimable?Comment parcourir les paramètres à analyser
attach(Liver)
cor.test(CI, ALAT, method = "spearman")
cor.test(CI, ASAT, method = "spearman")
cor.test(CI, GGT, method = "spearman")
cor.test(CI, Bili, method = "spearman")
cor.test(CI, LDH, method = "spearman")
cor.test(CI, FBG, method = "spearman")
cor.test(CVP, ALAT, method = "spearman")
cor.test(CVP, ASAT, method = "spearman")
cor.test(CVP, GGT, method = "spearman")
cor.test(CVP, Bili, method = "spearman")
cor.test(CVP, LDH, method = "spearman")
cor.test(CVP, FBG, method = "spearman")
cor.test(meanPAP, ALAT, method = "spearman")
cor.test(meanPAP, ASAT, method = "spearman")
cor.test(meanPAP, GGT, method = "spearman")
cor.test(meanPAP, Bili, method = "spearman")
cor.test(meanPAP, LDH, method = "spearman")
cor.test(meanPAP, FBG, method = "spearman")
cor.test(meanSAP, ALAT, method = "spearman")
cor.test(meanSAP, ASAT, method = "spearman")
cor.test(meanSAP, GGT, method = "spearman")
cor.test(meanSAP, Bili, method = "spearman")
cor.test(meanSAP, LDH, method = "spearman")
cor.test(meanSAP, FBG, method = "spearman")
detach("Liver")
Il y a aussi 'rcorr' dans" Hmisc "qui vous donnera une matrice séparée pour les coefficients de corrélation et les p-values . – A5C1D2H2I1M1N2O1R2T1