One way to get a view on the structure in categorical data is the mosaic plot. An example of this type of data is the dataset ‘Titanic’ which is available in the demo data within ‘Cornerstone’. A possible result is the following graph.
How do we realize this result in ‘Cornerstone’ using ‘Mosaic Plot’ from ‘CornerstoneR’?
To achieve this result in ‘Cornerstone’ open a dataset, e.g. ‘Titanic’ and choose menu ‘Analysis’ -> ‘CornerstoneR’ -> ‘Mosaic Plot’ as shown in the following screenshot.
In the appearing dialog select variable ‘pclass’ and ‘age’ to predictors. ‘sex’ and ‘survived’ are the response variables.
‘OK’ confirms your selection and the following window appears.
Now, click the execute button (green arrow) or choose the menu ‘R Script’ -> ‘Execute’ and all calculations are done via ‘R’. Calculations are done if the text at the lower left status bar contains ‘Last execute error state: OK’. Our result is available via the menu ‘Graphs’ -> ‘Mosaic Plot (PNG)’ as shown in the following screenshot.
After clicking this menu a ‘Cornerstone’ graph with the mosaic plot from R opens.
You find the ‘Script Variables’ dialog via the menu ‘R Script’ -> ‘Script Variables’. The following dialog appears.
The options ‘Graphic Size: Width’ and ‘Graphic Size: Height’ control the size of the outputted mosaic plot. Default size is 700x700, which corresponds to a quadratic graphic.