[R] Profiles graphics in a contingency table
Kjetil Brinchmann Halvorsen
kjetil at acelerate.com
Sat Feb 12 15:46:57 CET 2005
Campo Elías PARDO wrote:
>Dear Users,
>
>
>How can I obtain a profiles graphic in a CT similar to Excel.
>
>Campo Elias PARDO
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>
>
>
>
If you mean profiles as in correspondence analysis, just do:
( assuming your table is mytab)
N <- sum(mytab)
Nr <- rowSums(mytab)
Nc <- colSums(mytab)
perfRow <- mytab
for (i in 1:NROW(mytab)) }{
perfRow[i,] <- perfRow[i,]/Nr[i] }
perfRow
and then you can just plot them, maybe using lines().
But have a look into ?mosaicplot
Kjetil
--
Kjetil Halvorsen.
Peace is the most effective weapon of mass construction.
-- Mahdi Elmandjra
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
More information about the R-help
mailing list