[R-sig-ME] Help with mosaic plot
Francesco Romano
francescobryanromano at gmail.com
Thu Nov 20 00:48:40 CET 2014
I'm not sure which list to post this help request to but I thought I'd
start from here since the model is based on a glmer analysis.
I have a 2x2x2 table with two factors, prime and syntax-semantics, and a
dependent categorical dependent, response. Syntax-semantics has two levels,
+AN's+AN and +AN of +AN, Prime also has to levels, primed and non-primed,
and Response can be either correct or inversion. I attach a copy of the
data below but I'm not sure it will display properly in the message. If
not, the data is Correct [ Prime (+AN 's +AN = 50, +AN of +AN = 36) &
Non-primed (+AN 's +AN = 52, +AN of +AN = 54)] and Inversion [ Prime (+AN
's +AN = 5, +AN of +AN = 10) & Non-primed (+AN 's +AN = 1, +AN of +AN =
3)].
I'm having a very hard time finding any instructions anywhere on how to get
the mosaic plot to display Prime and Syntax-semantics on the vertical axis
(left side) where the latter is nested in the former, and Response on the
top horizontal axis. This should generate four rows of boxes, alternating
+AN's+AN and +AN of +AN vertically twice, with each row split into correct
and inversion boxes.
I'm also looking for other cosmetics:(1) if the factors can't be nested,
Syntax-semantics must be on the left side; (2) a split and not just change
of shading between the correct and inversion boxes in each row as in
stacked bars; (3) the width of the correct and inversion boxes to be the
same across the row (the length of the box should express differences in
counts); (4) lighter grey shading for the correct box in each row; (5) no
borders on the boxes.
It is in keeping with other mosaic plots I've used where the priming factor
was irrelevant that I'm trying to stick to the above. A sample command line
I've been using is:
>mosaic(~Response|Syntax.Semantics, data = X, gp = gpar(fill =
grey.colors(2)[2:1]))
Many thanks in advance for any advice.
Frank
Response
Primed
Non-primed
+AN 's +AN
+AN of +AN
+AN 's +AN
+AN of +AN
Correct
50
36
52
54
Inversion
5
10
1
3
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list