V1
[1] 592 119 849 504 36 v2=c(544,97,677,451,14) v2
[1] 544 97 677 451 14
> M=matrix(c(v1,v2),ncol=5,byrow=T)
> M [,1] [,2] [,3] [,4] [,5]
[1,] 592 119 849 504 36
[2,] 544 97 677 451 14
> dimnames(M)=list(c("garçons","filles"),c("blanc","roux","chatain","brun","noir"))
> M blanc roux chatain brun noir garçons 592 119 849 504 36 filles 544 97 677 451 14
> #tab de fréquences
> MF=M/sum(M)
>
> MF blanc roux chatain brun noir garçons 0.1524594 0.03064641 0.2186454 0.1297965 0.009271182 filles 0.1400979 0.02498069 0.1743497 0.1161473 0.003605460
> round(MF*100,2) blanc roux chatain brun noir garçons 15.25 3.06 21.86 12.98 0.93 filles 14.01 2.50 17.43 11.61 0.36
> #PROFILS LIGNES
> prop.table(MF,1) blanc roux chatain brun noir garçons 0.2819048 0.05666667 0.4042857 0.2400000 0.017142857 filles 0.3051038 0.05440269 0.3796971 0.2529445 0.007851935
> profL=prop.table(M,1)
> profL blanc roux chatain brun noir garçons 0.2819048 0.05666667 0.4042857 0.2400000 0.017142857 filles 0.3051038 0.05440269 0.3796971 0.2529445 0.007851935
> profc=prop.table(M,2)
> profc blanc roux chatain brun noir garçons 0.5211268 0.5509259 0.5563565 0.5277487 0.72 filles 0.4788732 0.4490741 0.4436435 0.4722513 0.28
> sum(profL)
[1] 2
> sum(profL,garçons)
Error: object 'garçons' not found
#VARIABLE QUALITATIF NOMINALE
> #PAS DE CALCUL DE FREQUENCE CUMULée
> #les graphiques
> #deux diagrammes baton sur le num
> #graphique nomée garcon fille
> par(mfrow=c(2,1))
> barplot(MF[1,],main="Garcons")
> barplot(MF[2,],main="Filles")
> par(mfrow=c(2,2))
> pie(M)
> pie(M)
> pie(M)
> pie(M)
> par(mfrow=c(4,4))
> pie(M)
> pie(M)
> pie(M)
>
> pie(M)
> barplot(MF[1,],main="garcons")
> barplot(MF[2,],main="filles")
> barplot(MF[2,],main="filles")
> barplot(MF[1,],main="garcons")
>