In this assignment you will be looking at anthropometric variation as discussed in chapter 11 of Mielke, Konigsberg, and Relethford.
For each question you will load and run code to produce plots and then answer some follow-up questions.
Make sure to read all the way to the end of each question to answer the follow-up questions.
Load and run Fig11.07()
Fig11.07 = function ()
{
dacount=structure(list(age = c(0, 0.50137, 1.00274, 1.50411, 2.00274,
2.50411, 3.00274, 3.50411, 4.00274, 4.589041, 5.005479, 5.591781,
6.005479, 6.558904, 7.005479, 7.254795, 7.506849, 8.005479, 8.506849,
9.008219, 9.627397, 10.00822, 11.50959, 12.00822, 12.67671, 13.01096,
13.51233, 14.01096, 14.53973, 15.01644, 15.53425, 16.2, 16.52877,
17.01918, 17.12055, 17.44658, 17.6), height = c(51.4, 65, 73.1,
81.2, 90, 92.8, 98.8, 100.4, 105.2, 109.5, 111.7, 115.5, 117.8,
122.9, 124.3, 127, 128.9, 130.8, 134.4, 137, 140.1, 141.9, 148.6,
149.9, 154.1, 155.3, 158.6, 162.9, 169.2, 175, 177.5, 181.4,
183.3, 184.6, 185.4, 186.5, 186.8)), .Names = c("age", "height"
), class = "data.frame", row.names = c(NA, -37L))
pbheight.fm<<-height ~ h1 - 2 * (h1 - hc)/(exp(s0 * (age - c)) + exp(s1 * (age -
c)))
pbheight.st=structure(list(h1 = 180, s0 = 0.1, s1 = 1, c = 15, hc = 120), .Names = c("h1",
"s0", "s1", "c", "hc"), row.names = c(NA, -1L), class = "data.frame")
pbheight.dist<<-nls(pbheight.fm,data=dacount,start=pbheight.st)
plot(dacount,xlab='Age',ylab='Stature (cm)',main="Count de Montbeillard's son")
lines(seq(0,20,.1),predict(pbheight.dist,newdata=list(age=seq(0,20,.1))))
}
Paste the resulting plot from Fig11.07
into your document.
What is the approximate age of the adolescent growth spurt on this plot? How do you know?
Load and run Fig11.08()
WARNING: #2 and #3 both depend on having run #1 FIRST.
Fig11.08 = function ()
{
env=new.env()
assign('age',seq(0,20,.1),envir=env)
parms=coef(pbheight.dist)
assign('h1',parms[1],envir=env)
assign('s0',parms[2],envir=env)
assign('s1',parms[3],envir=env)
assign('c',parms[4],envir=env)
assign('hc',parms[5],envir=env)
pbheight.fm=expression(h1 - 2 * (h1 - hc)/(exp(s0 * (age - c)) + exp(s1 * (age -
c))))
y=eval(D(pbheight.fm,'age'),env)
plot(seq(0,20,.1),y,type='l',xlab='Age',ylab='Instantaneous Growth Rate',
main='Velocity Curve')
}
Paste the resulting graph into your document.
If you had two velocity curves, one for boys and one for girls, what is the primary way in which you would expect them to differ?
Load and run Fig11.08b()
Fig11.08b = function ()
{
env=new.env()
assign('age',seq(0,20,.1),envir=env)
parms=coef(pbheight.dist)
assign('h1',parms[1],envir=env)
assign('s0',parms[2],envir=env)
assign('s1',parms[3],envir=env)
assign('c',parms[4],envir=env)
assign('hc',parms[5],envir=env)
pbheight.fm=expression(h1 - 2 * (h1 - hc)/(exp(s0 * (age - c)) + exp(s1 * (age -
c))))
dd=D(D(pbheight.fm,'age'),'age')
y=eval(dd,env)
plot(seq(0,20,.1),y,type='l',xlab='Age',ylab='Change in velocity',
main='Acceleration Curve')
abline(h=0)
}
Paste the resulting plot into your document.
Explain how the timing of the adolescent growth spurt is related to adult height.
You will need to download a package for this one: install.packages("scatterplot3d")
Load the script from below.
Fig11.14.util = function(ecc=1)
{
library(scatterplot3d)
edge=2
cube <- rbind(c(0,0,1), 0, c(1,0,0), c(1,1,0),1, c(0,1,1), # < 6 outer
c(1,0,1), c(0,1,0)) # <- "inner": fore- & back-ground
vert=ecc*edge
horz=sqrt(8/vert)
cub=cube*(rep(1,8)%o%c(horz,horz,vert))
cube=scatterplot3d(cub[c(1:6,1,7,3,7,5) ,], type = 'l',box=F,axis=F,xlab='',
ylab='',zlab='',grid=F,lty.hide=2,xlim=c(0,8),ylim=c(0,8),zlim=c(0,8))
cube$points3d(cub[c(2,8,4,8,6), ], type = 'l',lty=3)
mtext(side=1,adj=0,
bquote('Surface area'==.(4*vert*horz+2*horz^2)~cm^2))
mtext(side=1,adj=0,line=1,
bquote('Volume'==.(horz^2*vert)~cm^3))
mtext(side=1,adj=0,line=2,
bquote('SA/Vol'==.((4*vert*horz+2*horz^2)/(horz^2*vert))))
}
Fig11.14=function(){
opar = par(no.readonly = T)
on.exit(par(opar))
if(.Platform$OS.type=='windows') quartz=function() windows()
quartz()
par(mfrow=c(2,2))
Fig11.14.util(1)
Fig11.14.util(2)
Fig11.14.util(3)
Fig11.14.util(4)
}
Run Fig11.14()
and paste the results into your document.
How do these plots represent Allen’s Rule?
Use Allen’s rule to explain how the environment of the first rabbit likely differs from that of the second rabbit: