simDat73: Simulate data for Chapter 7.3: ANOVA with random effects of...

View source: R/dataSimulation.R

simDat73R Documentation

Simulate data for Chapter 7.3: ANOVA with random effects of population

Description

Simulate snout-vent length measurements of nSample smooth snakes in each of nPops populations. Data are simulated under the assumptions of a model with random effects of populations

Usage

simDat73(nPops = 10, nSample = 12, pop.grand.mean = 50, pop.sd = 3, sigma = 5)

Arguments

nPops

Number of populations

nSample

Samples from each population

pop.grand.mean

Mean of population means (hyperparameter)

pop.sd

Standard deviation of population means (hyperparameter)

sigma

Value for the residual standard deviation

Value

A list of simulated data and parameters.

nPops

Number of populations

nSample

Number of samples per population

pop.grand.mean

Mean of population means

pop.sd

SD of population means

sigma

Residual SD

pop

Indicator for population number

pop.means

Simulated population means

eps

Simulated residuals

y

Simulated lengths

Author(s)

Marc Kéry

Examples

str(dat <- simDat73())      # Implicit default arguments
# More pops, more snakes in each, more among-population variability
str(dat <- simDat73(nPops = 20, nSample = 30, pop.sd = 8)) 

# Revert to "model-of-the-mean" (larger sample size to minimize sampling variability)
str(dat <- simDat73(nSample = 1000, pop.sd = 0, sigma = 5))


ASMbook documentation built on Sept. 11, 2024, 5:38 p.m.

Related to simDat73 in ASMbook...