plot.dmm {dmm} | R Documentation |
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.
## S3 method for class 'dmm'
plot(x, traitset = "all", gls = F, ...)
x |
An object of class |
traitset |
Either a character vector specifying trait names to be plotted, or the default valuse which is |
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 |
... |
Other arguments passed to plotting functions. |
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.
There is no return value. Function is used for its side effects.
Neville Jackson
Function print.dmm()
.
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)