O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Carregando em…3
×

1 de 8 Anúncio

# Mosaic plot in R.

Data visualization with R.
Mosaic plot .
---Ref: https://www.stat.auckland.ac.nz/~ihaka/120/Lectures/lecture17.pdf
https://stat.ethz.ch/R-manual/R-devel/library/graphics/html/mosaicplot.html

Data visualization with R.
Mosaic plot .
---Ref: https://www.stat.auckland.ac.nz/~ihaka/120/Lectures/lecture17.pdf
https://stat.ethz.ch/R-manual/R-devel/library/graphics/html/mosaicplot.html

Anúncio
Anúncio

## Mais Conteúdo rRelacionado

Anúncio

Anúncio

### Mosaic plot in R.

1. 1. Prepared by Volkan OBAN Visualizing Categorical Data Mosaic Plots:
2. 2. Example: mat <- matrix(c(120,230,84,70,130,83,13,26,18),3) dimnames(mat) <- list(c("good","fair","poor"),c("a","b","c")) mat a b c good 120 70 13 fair 230 130 26 poor 84 83 18 library(vcd) mosaic(mat, shade=TRUE)
3. 3. Example: > library(vcd) > assoc(HairEyeColor, shade=TRUE)
4. 4. Example: > library(vcd) > mosaic(HairEyeColor, shade=TRUE, legend=TRUE)
5. 5. Example: >library(vcd) > require(stats) > mosaicplot(Titanic, main = "Survival on the Titanic", color = TRUE)
6. 6. Example: > fm <- loglin(HairEyeColor, list(1, 2, 3)) 2 iterations: deviation 5.684342e-14 > pchisq(fm\$pearson, fm\$df, lower.tail = FALSE) [1] 5.320872e-23 > mosaicplot(HairEyeColor, shade = TRUE, margin = list(1:2, 3))
7. 7. Example > data(Titanic) > > mosaicplot(Titanic,main = "Survival on the Titanic",col = hcl(c(240, 120) ),off = c(5, 5, 5, 5))
8. 8. Example: > data(UCBAdmissions) > > mosaicplot(UCBAdmissions, sort = 3:1,col = hcl(c(120, 10)),main = "Studen t admissions at UC Berkeley") Ref: https://www.stat.auckland.ac.nz/~ihaka/120/Lectures/lecture17.pdf http://www.statmethods.net/advgraphs/mosaic.html https://stat.ethz.ch/R-manual/R-devel/library/graphics/html/mosaicplot.html