View source: R/dataSimulation.R
simDat9 | R Documentation |
Simulate mass ~ length regressions in 3 populations of asp vipers
simDat9(
nPops = 3,
nSample = 10,
beta.vec = c(80, -30, -20, 6, -3, -4),
sigma = 10
)
nPops |
Number of populations |
nSample |
Samples from each population |
beta.vec |
Vector of regression parameter values |
sigma |
Value for the residual standard deviation |
A list of simulated data and parameters.
nPops |
Number of populations |
nSample |
Number of samples per population |
beta.vec |
Regression parameter values |
sigma |
Residual SD |
x |
Indicator for population number |
pop |
Population name (factor) |
lengthC |
Centered body length for each viper |
mass |
Simulated body mass for each viper |
Marc Kéry
# Implicit default arguments (with interaction of length and pop)
str(dat <- simDat9())
# Revert to main-effects model with parallel lines
str(dat <- simDat9(beta.vec = c(80, -30, -20, 6, 0, 0)))
# Revert to main-effects model with parallel lines
# (larger sample size to better show patterns)
str(dat <- simDat9(nSample = 100, beta.vec = c(80, -30, -20, 6, 0, 0)))
# Revert to simple linear regression: no effect of population
# (larger sample size to better show patterns)
str(dat <- simDat9(nSample = 100, beta.vec = c(80, 0, 0, 6, 0, 0)))
# Revert to one-way ANOVA model: no effect of body length
# (larger sample size to better show patterns)
str(dat <- simDat9(nSample = 100, beta.vec = c(80, -30, -20, 0, 0, 0)))
# Revert to "model-of-the-mean": no effects of either body length or population)
str(dat <- simDat9(nSample = 100, beta.vec = c(80, 0, 0, 0, 0, 0)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.