plotworth {prefmod} | R Documentation |
A plot of the worth or model parameter matrix obtained from the fit of an LLBT or pattern model is produced.
The parameter matrix is produced by llbt.worth
or patt.worth
.
plotworth(worthmat, main = "Preferences", ylab = "Estimate", psymb = NULL, pcol = NULL, ylim = range(worthmat))
worthmat |
parameter matrix as generated from llbt.worth or patt.worth .
Alternatively, the contents of a user defined matrix can also be plotted
(for an example see llbt.design ,
provided that the rows correspond to objects and the columns to groups. |
main |
main title of the plot. |
ylab |
y-axis label |
psymb |
plotsymbols for objects, see Details below |
pcol |
colours for objects, see Details below |
ylim |
limits for y-axis |
Plotsymbols can be defined as an integer vector of length equal to the
number of objects, e.g., psymb = c(15,22,18)
. They specify the graphical option pch
as used in
the points
function. The default (psymb = NULL
) uses
the symbols 15 through 18 and 21 through 25. The number of symbols is determined
from the number of rows in worthmat
. A display of some plotsymbols may
be obtained from the correponding example below.
If pcol = NULL
, the colours for objects are defined from the rainbow_hcl palette unsing
the colorspace package.
Other specifications include "heat", "terrain" (see rainbow_hcl
), and "gray" (see grDevices
).
The number of different colours is automatically determined via the number of objects.
Alternatively, pcol
can be specified as a character vector containing user defined RGB colour
values for all objects (as hexadecimal strings in the form "#rrggbb"
), e.g., for blue "#0000FF"
).
These are usually set up using standard colour palettes (see rainbow
or, e.g., the
RColorBrewer
package (see Examples below).
Reinhold Hatzinger
## fit only first three objects with SEX effect data(cemspc) m2 <- pattPC.fit(cemspc, nitems=3, formel=~SEX, elim=~SEX, undec=TRUE) ## calculate and plot worth parameters m2worth <- patt.worth(m2) plotworth(m2worth) plotworth(m2worth, pcol = "terrain") ## display of some plotsymbols (pch) plot(0:25, rep(1,26), pch=0:25, cex=1.5) text(0:25, rep(0.95,26), 0:25) ## usage of the RColorBrewer package ## Not run: library(RColorBrewer) mypalette <- brewer.pal(3, "Set1") plotworth(m2worth, pcol = mypalette) ## End(Not run)