Usage
samp.dist(parent, parent2 = parent, s.size = 1, s.size2 = s.size,
n.seq = seq(1, 30),R = 1000, breaks = 30, stat = mean, stat2 = NULL,
stat3 = NULL, stat4 = NULL, fix.n = TRUE, xlab = expression(bar(x)),
ylab = "Relative frequency", ylim = NULL, func = NULL, show.n = TRUE,
show.SE = FALSE, est.density = TRUE, col.density = 4, lwd.density = 2,
est.ylim = TRUE, anim = TRUE, interval = 0.01, col.anim = "rainbow",
digits = 3,...)
samp.dist.fixn(parent, parent2 = parent, s.size = 1, s.size2 = s.size,
R = 1000, breaks = 30, stat = mean, stat2 = NULL, stat3 = NULL, stat4 = NULL,
xlab = expression(bar(x)), ylab = "Relative frequency", func = NULL,
show.n = TRUE, show.SE = FALSE, anim = TRUE, interval = 0.01,
col.anim = "rainbow", digits = 3,...)
samp.dist.n(parent, R = 500, n.seq = seq(1, 30), stat = mean,
xlab = expression(bar(x)), ylab = "Relative frequency", breaks = 30, func = NULL,
show.n = TRUE, show.SE = FALSE, est.density = TRUE, col.density = 4,
lwd.density = 2, est.ylim = TRUE, ylim = NULL, anim = TRUE, interval = 0.5,
col.anim = NULL, digits = 3,...)
Arguments
parent
A vector containing observations from a parental distribution. For computational efficiency datasets exceeding 100000 observations are not recommended.
parent2
An optional second parental distribution, useful for construction sampling distributions of test statistics.
s.size
Sample size to be taken at each of R
iterations from the parental distribution.
s.size2
An optional second sample size if a second statistic is to be calculated.
n.seq
A two element vector specifying the smallest and largest in a range of demonstrated sample sizes. Requires fix.n=FALSE
.
R
The number of samples to be taken from parent distribution(s).
breaks
Number of breaks in the histogram.
stat
The statistic whose sampling distribution is to be represented. Will work for any summary statistic; e.g. mean
, var
, median
stat2
An optional second statistic. Useful for conceptualizing sampling distributions of test statistics. Calculated from sampling parent2
.
stat3
An optional third statistic. The sampling distribution is created from the same sample data used for stat
.
stat4
An optional fourth statistic. The sampling distribution is created from the same sample data used for stat2
fix.n
Logical indicating whether or not sample size should be held constant in demonstrations (see below).
ylim
Limits for Y-axis. Specify using a two element vector.
func
An optional function used to compare the sampling distributions of two statistics. The function must have only sampling distributions, i.e. s.dist1
, s.dist2
, s.dist3
, and/or s.dist
as non-fixed argument
show.n
A logical command, TRUE
indicates that sample size for parent
will be displayed.
show.SE
A logical command, TRUE
indicates that bootstrap standard error for the statistic will be displayed.
est.density
A logical command, if TRUE
then a density line is plotted over the histogram. Only used if fix.n = true
.
col.density
The color of the density line. See est.density
above.
lwd.density
The width of the density line. See est.density
above.
est.ylim
Logical. If TRUE
Y-axis limits are estimated logically for the animation. Consistent Y-axis limits make animations easier to visualize. Only used if fix.n = TRUE
.
anim
A logical command indicating whether or not animation should be used.
interval
Animation speed. Decreasing interval
increases speed.
digits
The number of digits to be displayed in the bootstrap standard error.