Learn R Programming

touchard (version 2.0.1)

touplot: Touchardness Plot

Description

Touchardness Plot: diagnostic distribution plot for the Touchard model.

Usage

touplot(x, freq = NULL, plot = TRUE, conf.level = 0.95, 
                       ylab = "Count Metameter", xlab = "Count", 
                       main = "Touchardness Plot", ...)

Arguments

x

either a vector of counts or a 1-way table of frequencies of counts.

freq

unnecessary (and ignored) if x is a table or the raw data; must be provided if x is the unique values of the observed counts, in the same order.

plot

logical. Should the plot be displayed?

conf.level

numeric in (0,1). Confidence level for confidence intervals.

main

character. Title for the plot.

xlab

character. Label for the x axis.

ylab

character. Label for the y axis.

other parameters to be passed through to plotting functions.

Value

Returns invisibly a data frame containing the counts (y), frequencies (freq), count metameter (metameter), the CI center (CIcenter) and the CI margin (CImargin).

Details

Plots the number of occurrences (counts) against the count metameter of the Touchard distribution. Circles are the observed count metameters and the filled points show the confidence interval (dashed lines) centers. Estimate of \(\lambda\) based on the fitted line is shown on top margin along with the MLE (toufit). If the Touchard model fits the data well, the plot should show a straight line and the two estimates of \(\lambda\) should be close.

References

D. C. Hoaglin, F. Mosteller & J. W. Tukey (eds.), Exploring Data Tables, Trends and Shapes, chapter 9. John Wiley & Sons, New York.

M. Friendly & D. Meyer (2015), Discrete Data Analysis with R. Chapman and Hall.

See Also

rgram

Examples

Run this code
# NOT RUN {
data(Epilepsy)
touplot(seizures)
touplot(seizures, plot=FALSE)
# }

Run the code above in your browser using DataLab