50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

hint (version 0.1-1)

overlay.sim: Overlay Simulation Results on Distribution

Description

This function adds simulated data to a distribution plot.

Usage

overlay.sim(sim, breaks, col = "red", pch = 1, lwd = 1)

Arguments

sim
A vector of integers (simulated data). See sim.hypint and sim.hydist.
breaks
A vector of integers specifying the x-axis range for which simulated data values should be plotted.
col
A character string naming the colour of the data points. Defaults to "red".
pch
A number specifying the point type. Defaults to 1.
lwd
A number specifying the line width. Defaults to 1.

Value

Simulated data will be added to an existing plot.

References

Kalinka, A.T. (2013). The probability of drawing intersections: extending the hypergeometric distribution. arXiv.1305.0717

See Also

sim.hypint, sim.hydist.

Examples

Run this code
## Generate exact distribution and plot:
dd <- dhint(108, c(54,76,89))
plot(dd[,1], dd[,2], col="blue")
## Simulate drawing from 3 urns (sims should be larger).
nn <- sim.hydist(108, c(54,76,89), sims = 10)
## Add data to existing distribution plot:
overlay.sim(nn, breaks = 0:54)

Run the code above in your browser using DataLab