This function plots univariate and bivariate frequency tables of class
“freqtab
”.
# S3 method for freqtab
plot(
x,
y = NULL,
xcol = 1,
ycol,
pch = 16,
ylty = 1,
xlab = names(dimnames(x))[1],
addlegend = !missing(y),
legendtext,
...
)# S3 method for freqtab
points(x, xcol = 1, pch = 16, ds = 50, dm = 100, ...)
univariate or bivariate score distribution of class
“freqtab
”.
either an object of class “freqtab
”, where
frequencies will be extracted, or a vector or matrix of frequencies, to be
added to the plot of x
. See below for details.
colors used in plotting x
and y
.
plotting symbol used to plot bivariate points.
line type used to plot frequencies in y
.
label for the x axis.
logical indicating whether or not a legend should be added.
character vector of text to be passed to the legend
argument of the legend
function, defaulting to column names used in
y
.
further arguments passed to or from other methods, such as
graphical parameters besides col
, type
, and pch
.
integers for the scaling and center of the RGB density values,
with defaults of 50 and 100. These are used to convert the observed counts
in x
to the [0, 255] range of RGB values.
The univariate option produces a single line plot of type =
"h"
. Frequencies from y
are then superimposed. The bivariate option
produces a scatterplot with a marginal frequency plot for each distribution.
For the points method, a scatterplot for x
is added to the current
opened plot.
For the plot method, when x
is univariate, i.e, having 2 columns, a
frequency plot is created for x
. When x
is bivariate, e.g.,
coming from a single group equating design or one form of a nonequivalent
groups design, a scatterplot is produced with frequency plots for the
marginal distributions.
y
is used to superimpose lines, e.g., smoothed frequencies, over the
(marginal) frequencies of x
.
Colors must be specified using xcol
and ycol
. When ycol
is missing, a vector of colors is created using rainbow(ncol(y))
.
# NOT RUN {
x <- freqtab(KBneat$x, scales = list(0:36, 0:12))
plot(x)
xs <- loglinear(x, degrees = c(4, 1),
stepup = TRUE, showWarnings = FALSE)
plot(x, xs, lwd = 2)
# }
Run the code above in your browser using DataLab