plot.dmm {dmm}R Documentation

Plot residuals from fitting dyadic model

Description

Plots dyadic residuals as five separate plots showing histogram of residuals, qqnorm plot of residuals, fitted values against residuals, dyadic covariances against residuals, and dyadic covariances against fittes values. Multi trait case shows all trait pairs on each plot.

Usage

## S3 method for class 'dmm'
plot(x, traitset = "all", gls = F, ...)

Arguments

x

An object of class dmm. This will be a 'fit' object for the dyadic model equations. It should contain attributes dme.fit and dme.psi obtained by calling dmm() with arguments dmekeep=TRUE and dmekeepfit=TRUE respectively.

traitset

Either a character vector specifying trait names to be plotted, or the default valuse which is "all" meaning plot all traits present in object x.

gls

A logical flag. Should the plot be of dyadic residuals given OLS-b fixed effects, or of dyadic residuals given GLS-b fixed effects. Default is gls=FALSE.

...

Other arguments passed to plotting functions.

Details

In plots with gls=FALSE there will be N^{2} residuals, where N is the number of individuals with data. In plots with gls=TRUE there will be N^{2} * L^{2} residuals, where L is the number of traits. This is because the GLS-b fit is always multivariate, whereas the OLS-b fit is multi-trait, just like a multiple regression with multi-trait response.

Value

There is no return value. Function is used for its side effects.

Author(s)

Neville Jackson

See Also

Function print.dmm() .

Examples

library(dmm)
data(sheep.df)
sheep.mdf <- mdf(sheep.df,pedcols=c(1:3),factorcols=c(4:6),ycols=c(7:9),
             sexcode=c("M","F"),relmat=c("E","A"))
# make a simple fit object - OLS-b only
sheep.fit1 <- dmm(sheep.mdf, Ymat ~ 1 + Year + Sex,
    components=c("VarE(I)","VarG(Ia)"),
    dmekeep=TRUE,dmekeepfit=TRUE)
# plot dyadic model residuals for all traits
plot(sheep.fit1)
#cleanup
rm(sheep.fit1)
rm(sheep.mdf)
rm(sheep.df)


[Package dmm version 2.1-9 Index]