# Afc.r library(descr) library(ca) ############################################################# # Exemple AFC: Nombre d'années d'éducation et type de travail load("TravEduc.rda") crosstab(TravEduc$Education,TravEduc$Travail,plot=FALSE) T <- xtabs(~TravEduc$Education+TravEduc$Travail) TE_AFC <- ca(T) summary(TE_AFC) plot(TE_AFC,mass=c("TRUE","TRUE")) #################################### # Exemple AFC: Ordination des femmes load("Ordination.rda") crosstab(Ordination$Votants,Ordination$Vote,plot=FALSE) O <- xtabs(~Ordination$Votants+Ordination$Vote) O_AFC <- ca(O) summary(O_AFC) plot(O_AFC,mass=c("TRUE","TRUE")) #################### # Exemple AFCm: GPEM load("GPEM.rda") summary(GPEM) # Normalisation: Burt GPEM_AFCm <- mjca(GPEM,ps=": ",lambda="Burt") summary(GPEM_AFCm) plot(GPEM_AFCm,what=c("none","all"),mass=c("TRUE","TRUE")) # Normalisation: adjusted GPEM_AFCm2 <- mjca(GPEM,ps=": ") summary(GPEM_AFCm2) plot(GPEM_AFCm2,what=c("none","all"),mass=c("TRUE","TRUE")) # Plot des modalités et des observations avec Burt plot(GPEM_AFCm,what=c("all","all"),mass=c("TRUE","TRUE")) ################################################# # Exemple AFCm: Revenu, opinion politique, région load("RevOpReg.rda") summary(RevOpReg) # Normalisation: Burt ROR_AFCm <- mjca(RevOpReg,ps=": ",lambda="Burt") summary(ROR_AFCm) plot(ROR_AFCm,what=c("none","all"),mass=c("TRUE","TRUE"))