Description Usage Format Source References Examples
Scientists studying social insects such as wasps and ants have
noted that queen and worker caste
s can have very different sizes
and shapes. For some species, the queens are simply larger, suggesting
that they continue to grow with the same basic ‘plan’ as workers.
They are just fed for longer. Jeanne, Graf and Yandell (1995)
examined a wasp species which does not follow this pattern. They
measured 13 responses on 50 workers and 50 queens. The measurements
were coded based on body part – head (H
), thorax
(T
), wing (W
) or gonadium (G
) – and kind of
measurement – width (W
), height (H
) and length (L
).
The gonadium (also known as gastral tergite) has two length and three
width measurements.
1 |
Wasp data frame with 100 observations on 14 variables.
[,1] | caste | factor | Queen or Worker |
[,2] | TL | numeric | thorax length |
[,3] | WL | numeric | wing length |
[,4] | HH | numeric | head height |
[,5] | HW | numeric | head width |
[,6] | TH | numeric | thorax height |
[,7] | TW | numeric | thorax width |
[,7] | G1L | numeric | gonadium lenght 1 |
[,7] | G2Wa | numeric | gonadium width 2a |
[,7] | G2L | numeric | gonadium length 2 |
[,4] | HL | numeric | head length |
[,7] | G1Wb | numeric | gonadium width 1b |
[,7] | G1Wa | numeric | gonadium width 1a |
[,7] | G1H | numeric | gonadium height 1 |
Robert L Jeanne
Jeanne RL, Graf CA and Yandell BS (1995) ‘Non-size-based morphological castes in a social insect’, Naturwissenschaften 82, 296-298.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | data( Wasp )
## Multivariate discriminant analysis
library(MASS)
Wasp.lda <- lda( Wasp[,-1], Wasp$caste )
Wasp.lda
Wasp$DA <- predict( Wasp.lda, Wasp[,-1] )$x
## Univariate t statistics
tmp <- Wasp$caste == "Q"
Wasp.t <- apply( Wasp[,-1], 2, function( x ) {
( mean( x[tmp] ) - mean( x[!tmp] ) ) /
sqrt( ( var( x[tmp] ) + var( x[!tmp] ) ) / sum( tmp ) ) } )
rm( tmp )
Wasp.t <- sort( Wasp.t )
Wasp.tmpy <- cor( Wasp[,2:14], Wasp$DA )[ names( Wasp.t[-1] ), 1 ]
## Figure F:18.2 Wasp scatter plots
pairs( Wasp[ , c("HW","TW","G1Wa","DA") ], panel =
function( x, y, ... ) {
text( x, y, as.character( Wasp$caste ) ) },
labels = c("head","thorax","gonadium",
"discriminant\nanalysis" ) )
title( "Figure F:18.2 Wasp scatter plots" )
## Figure F:18.3 Wasp discriminant analysis
plot( c(1,-1) * Wasp.t["DA"], c(1,-1), type = "n",
xlab ="t statistics", ylab = "correlation with DA" )
text( c(1,-1) * Wasp.t["DA"], c(1,-1), "DA" )
lines( Wasp.t[-1], Wasp.tmpy )
points( Wasp.t[-1], Wasp.tmpy )
text( Wasp.t[-1] + 5 * sign( Wasp.t[-1] ),
uncollide(Wasp.tmpy,.05), names( Wasp.t[-1] ) )
abline(h=0,v=0,lty=2)
mtext("queen larger",1,2,adj=1)
mtext("worker larger",1,2,adj=0)
title( "Figure F:18.3 Wasp discriminant analysis" )
# Figure F:18.5 Wasp analysis of covariance
Wasp.cov <- aov( HW ~ G1Wa * caste, Wasp )
anova( Wasp.cov )
Wasp.par <- aov( HW ~ G1Wa + caste, Wasp )
anova( Wasp.par )
print(xyplot(HW ~ G1Wa, Wasp, group = caste, type = "p",
pch = levels(Wasp$caste), col = 1 + seq(along = levels(Wasp$caste)),
panel = function(x,y,...) {
panel.superpose(x,y,...)
lc = levels(Wasp$caste)
for(i in seq( along = lc )) {
ii = lc[i] == Wasp$caste
panel.lines(Wasp$G1Wa[ii], predict(Wasp.cov)[ii],
lty = 3, col = i)
panel.lines(Wasp$G1Wa[ii], predict(Wasp.par)[ii],
lty = 1, col = i)
}
},
xlab ="(a) gonadium width (G1Wa)",
ylab = "head width (HW)",
main = "Figure F:18.5 Wasp" ),
more = TRUE, split = c(1,1,2,1) )
## residual analysis after removing TW
Wasp.resid <- Wasp[,c("caste","HW","G1Wa","TW")]
Wasp.resid$Hres <- resid( aov( HW ~ TW, Wasp.resid ) )
Wasp.resid$Gres <- resid( aov( G1Wa ~ TW, Wasp.resid ) )
Wasp.covr <- aov( Hres ~ TW + G1Wa + caste, Wasp.resid )
anova( Wasp.covr )
Wasp.covwr <- aov( Hres ~ G1Wa + caste, Wasp.resid )
anova( Wasp.covwr )
Wasp.resid$TW <- rep( mean( Wasp.resid$TW ), nrow( Wasp.resid ) )
print(xyplot(Hres ~ G1Wa, Wasp.resid, group = caste, type = "p",
pch = levels(Wasp.resid$caste), col = 1 + seq(along = levels(Wasp.resid$caste)),
panel = function(x,y,...) {
panel.superpose(x,y,...)
lc = levels(Wasp.resid$caste)
for( i in seq(along = lc)) {
ii = lc[i] == Wasp.resid$caste
panel.lines(Wasp.resid$G1Wa[ii], predict(Wasp.covr, Wasp.resid)[ii],
lty = 1, col = i )
panel.lines(Wasp$G1Wa[ii], predict(Wasp.covwr)[ii],
lty = 3, col = i )
}
},
xlab ="(b) gonadium width (G1Wa)",
ylab = "HW residuals on TW",
main = "Analysis of Covariance" ),
split = c(2,1,2,1) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.