Description Usage Arguments Value Examples
Simulate quantiles for a sample estimator
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
estimator |
Anonymous function defining estimator of interest |
reps |
Number of samples per iteration of simulation |
sims |
Number of iteration in simulation |
frame |
Sampling frame from which to draw sample |
ref_samp |
A reference sample (reference sample estimate is blue abline in histogram) |
lowp |
Lower percentile in stats::quantile(.,probs=c(lowp,highp)) function (left red abline in histogram) |
highp |
Higher percentile in stats::quantile(.,probs=c(lowp,highp)) function (right red abline in histogram) |
replace |
Parameter for base::sample |
main |
Histogram title |
xlab |
Histogram x-axis label |
ylab |
Histogram y-axis label |
breaks |
Histogram breakpoints |
A list with two objecs: 1) Return the requested quantiles from "sims" iterations of the simulation and 2) Histogram with reference ablines with references for lowp, highp, and ref_samp over "sims" iterations of the simulation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #Test scores from the new test administered over the past 3 years is not
#available but the mean (75) and sd (14) is known
sim_scores <- as.vector(rnorm(1000, 75, 14))
#Practice test scores for low performing math class
practice_test <- as.vector(rnorm(30, 68, 7))
#See how low performers compare to past performers
#Run simulation
getqs <- simq(frame = sim_scores, ref_samp = practice_test ,
main = "Distribution of Practice Tests", xlab = "Sample Means")
#Get requested quantiles
getqs$quantiles
#Compare practice test to distribution of past tests
getqs$histogram
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.