Learn R Programming

psychotools (version 0.2-0)

plot.RSModel: Visualizing Rating Scale Models

Description

Base graphics plotting function for rating scale models.

Usage

## S3 method for class 'RSModel':
plot(x, pattern = TRUE, names = NULL, ref = NULL,
  main = NULL, ylab = "Latent trait", ylim = NULL,
  col = c("gray", "gray"), pch = c(21, 22), lty = c(2, 3),
  refline = TRUE, reflinecol = "lightgray", ...)

Arguments

x
an object of class "RSModel".
pattern
logical. If TRUE, the pattern of the item difficulties and threshold parameters is drawn, otherwise an effect plot similar to that of plot.PCModel is drawn, where additional ar
names
character vector containing x-axis labels for the item- and treshold parameters. If set to NULL (the default), these are generated.
ref
logical. If TRUE (the default), the threshold parameters are normed to sum zero, otherwise (FALSE), the first threshold parameter is set to zero.
main
character, specifying the overall title of the plot.
ylab
label for the y axis.
ylim
y axis limits
col
character vector of length two with color names for filling the points of the item difficulty and threshold parameters.
pch
numeric vector of length two, specifying the symbols used for drawing the item difficulty and threshold parameters (see points for possible values).
lty
numeric vector of length two, specifying the line type used for the connection lines between the various item difficulty and threshold parameters (see lines for possible values).
refline
logical. Should a horizontal line for the reference level (mean item difficulty) be drawn?
reflinecol
line color for reference line (if ref).
...
further arguments passed to plot or if pattern is TRUE, arguments similar to that of plot.PCModel.

See Also

RSModel.fit, plot.PCModel

Examples

Run this code
## Verbal aggression data
data("VerbalAggression", package = "psychotools")

## Rating scale model for the first other-to-blame
## situation: 'A bus fails to stop for me'
rsm <- RSModel.fit(VerbalAggression$resp[, 1:6])

## Basic plot with parameter patterns and custom labels.
lab <- c(paste(rep(c("Curse", "Scold", "Shout"), each = 2),
             rep(c("Want", "Do"), 3 ), sep = "-"), "Tau 1", "Tau 2")
plot(rsm, names = lab)

## Basic plot again, but omitting reference and connection lines
plot(rsm, refline = FALSE, lty = c(0, 0))

## Effects plot, similar to effect plots for PCModel's, with
## 'modus' as cutpoint via additional argument 'type'.
plot(rsm, pattern = FALSE, type = "mode")

Run the code above in your browser using DataLab