spikeplot | R Documentation |
Produces a spike plot of a numeric vector.
spikeplot(x, freq = FALSE, as.table = FALSE, col = par("col"),
lty = par("lty"), lwd = par("lwd"), lend = par("lend"),
type = "h", xlab = deparse1(substitute(x)), ylab = NULL,
capped = FALSE, cex = sqrt(lwd) / 2, pch = 19, pcol = col, scol = NULL,
slty = NULL, slwd = NULL, new.plot = TRUE, offset.x = 0, ymux = 1, ...)
x |
Numeric, passed into |
freq |
Logical. If |
as.table |
Logical.
If |
col , type , lty , lwd |
See |
lend , xlab , ylab |
See |
capped , cex , pch , pcol |
First argument is logical.
If |
scol , slty , slwd |
Similar to |
new.plot , offset.x |
Logical and numeric.
Add to an existing plot? If so, set |
ymux |
Numeric, y-multiplier. The response is multiplied by |
... |
Additional graphical arguments passed into an ordinary
|
Heaping is a very commonly occurring phenomenon in
retrospective self-reported survey data.
Also known as digit preference data,
it is often characterized by an excess of multiples of 10 or 5
upon rounding.
For this type of data
this simple function is meant to be convenient for
plotting the frequencies or sample proportions of
a vector x
representing a discrete random variable.
This type of plot
is known as a spike plot in STATA circles.
If table(x)
works then this function should hopefully
work.
The default for type
means that any heaping and
seeping should easily be seen.
If such features exist then GAITD regression is
potentially useful—see gaitdpoisson
etc.
Currently missing values are ignored totally because
table(x)
is used without further arguments;
this might change in the future.
Returns invisibly table(x)
.
T. W. Yee.
table
,
plot
,
par
,
deparse1
,
dgaitdplot
,
plotdgaitd
,
gaitdpoisson
.
## Not run:
spikeplot(with(marital.nz, age), col = "pink2", lwd = 2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.