View source: R/dataSimulation.R
simDat72 | R Documentation |
Simulate snout-vent length measurements of nSample smooth snakes in each of nPops populations Data are simulated under the assumptions of a model with fixed effects of populations
simDat72(nPops = 5, nSample = 10, pop.means = c(50, 40, 45, 55, 60), sigma = 5)
nPops |
Number of populations |
nSample |
Samples from each population |
pop.means |
Vector of mean length for each population |
sigma |
Value for the residual standard deviation |
A list of simulated data and parameters.
nPops |
Number of populations |
nSample |
Number of samples per population |
pop.means |
Population means |
sigma |
Residual SD |
pop |
Indicator for population number |
eps |
Simulated residuals |
y |
Simulated lengths |
Marc Kéry
str(dat <- simDat72()) # Implicit default arguments
# More pops, fewer snakes in each
str(dat <- simDat72(nPops = 10, nSample = 5, pop.means = runif(10,20,60)))
# Revert to "model-of-the-mean" (larger sample size to minimize sampling variability)
str(dat <- simDat72(nSample = 1000, pop.means = rep(50, 5), sigma = 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.