# Simple univariate animal model

Fitting a simple univariate model in R.

is the simplest of all animal models and assumes no repeated measures across years or individuals.

# Example data

For this tutorial we will use the simulated gryphon dataset (download zip file).

phenotypicdata <- read.csv("data/gryphon.csv")
pedigreedata <- read.csv("data/gryphonped.csv")

# The univariate animal model

Definitions

Sample code in the following examples includes the following variables:

• Response variable: Size
• Fixed effects: Intercept ($$\mu$$)
• Random effects: Additive genetic variance
• Data containing phenotypic information: phenotypicdata
• Data containing pedigree data:pedigreedata

We first fit the simplest possible animal model: no fixed effects apart from the interecept, a single random effect (the breeding values, associated with the additive genetic variance), and Gaussian redisuals.

# Adding fixed effects to a model

## Using MCMCglmm

model1.2<-MCMCglmm(BWT~SEX,random=~animal,
pedigree=Ped,data=Data,prior=prior1.1,
nitt=65000,thin=50,burnin=15000,verbose=FALSE)

posterior.mode(model1.2$Sol[,"SEX2"]) HPDinterval(model1.2$Sol[,"SEX2"],0.95)

posterior.mode(model1.2$VCV) posterior.heritability1.2<-model1.2$VCV[,"animal"]/
(model1.2$VCV[,"animal"]+model1.2$VCV[,"units"])
posterior.mode(posterior.heritability1.2)

HPDinterval(posterior.heritability1.2,0.95)

## Using ASReml

ASReml analysis of size
ANIMAL       !P
SIZE
SEX         !A  #denotes a factor
AGE          #here treated as a linear effect

pedigreedata.ped      !skip 1
phenotypicdata.dat    !skip 1    !DDF 1 !FCON #specifies method of sig testing

SIZE ~ mu  AGE SEX AGE.SEX !r ANIMAL

# 2 - Calculating heritability