simDat72: Simulate data for Chapter 7.2: ANOVA with fixed effects of...

View source: R/dataSimulation.R

simDat72R Documentation

Simulate data for Chapter 7.2: ANOVA with fixed 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 fixed effects of populations

Usage

simDat72(nPops = 5, nSample = 10, pop.means = c(50, 40, 45, 55, 60), sigma = 5)

Arguments

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

Value

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

Author(s)

Marc Kéry

Examples

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))


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

Related to simDat72 in ASMbook...