data("Employment")
## Employment Status
mosaic(Employment,
expected = ~ LayoffCause * EmploymentLength + EmploymentStatus,
main = "Layoff*EmployLength + EmployStatus")
mosaic(Employment,
expected = ~ LayoffCause * EmploymentLength + LayoffCause * EmploymentStatus,
main = "Layoff*EmployLength + Layoff*EmployStatus")
## Stratified view
grid.newpage()
pushViewport(viewport(layout = grid.layout(ncol = 2)))
pushViewport(viewport(layout.pos.col = 1))
## Closure
mosaic(Employment[,,1], main = "Layoff: Closure", newpage = FALSE)
popViewport(1)
pushViewport(viewport(layout.pos.col = 2))
## Replaced
mosaic(Employment[,,2], main = "Layoff: Replaced", newpage = FALSE)
popViewport(2)
Run the code above in your browser using DataLab