## show plot code

```
::include_graphics("images/Figure 13.1.jpg")
knitr
# jpeg ("images/Figure 13.1.jpg",4800,1800,res=600)
# library (bmmb)
# data(height_data)
# data (lee_etal_data)
#
# lee_etal_data$f0_original=lee_etal_data$f0
# lee_etal_data$f0 = log(lee_etal_data$f0_original)
#
# aggdmu = aggregate (f0 ~ age+gender, FUN = mean, data = lee_etal_data)
# aggdmu[,3] = exp(aggdmu[,3])
#
# lee_etal_data$f0 = log(lee_etal_data$f0sd/lee_etal_data$f0_original)
# aggdsd = aggregate (f0 ~ age+gender, FUN = sd, data = lee_etal_data)
# aggdsd[,3] = (exp(aggdsd[,3])-1)*aggdmu[,3]
#
# aggdmuf0 = aggdmu
# aggdsdf0 = aggdsd
#
# par (mfrow = c(1,3), mar = c(4.1,4.1,1,1))
#
# plot (height_data$age[height_data$gender=="f"]-.1,
# height_data$height[height_data$gender=="f"],
# pch=16,col=2,lwd=2,cex=1.5, ylim = c(70,205),type='b', xlab="Age (years)",
# ylab = "Height (cm)",xlim=c(2,21),cex.axis=1.3,cex.lab=1.3)
# lines (height_data$age[height_data$gender=="m"]+.1,
# height_data$height[height_data$gender=="m"],
# pch=16,col=4,lwd=2,cex=1.5,type='b')
# grid()
# legend (11,120,legend = c("Female","Male"), col = c(2,4),pch=16,cex=1.2,pt.cex=1.5)
#
#
# phonTools::errorbar(height_data$age[height_data$gender=="f"]-.1,
# height_data$height[height_data$gender=="f"],
# height_data$sd[height_data$gender=="f"]*2,col=2,lwd=1,length=0.051)
# phonTools::errorbar(height_data$age[height_data$gender=="m"]+.1,
# height_data$height[height_data$gender=="m"],
# height_data$sd[height_data$gender=="m"]*2,col=4,lwd=1,length=0.051)
#
# rect (9.5,128,12.5,168,lwd=2,border="forestgreen",lty=1)
# rect (17.5,150,20.5,190,lwd=2,border="forestgreen",lty=1)
#
# plot (aggdmu$age[aggdmu$gender=="f"]-.1,aggdmu$f0[aggdmu$gender=="f"],
# pch=16,col=2,lwd=2,cex=1.5, ylim = c(50,370),type='b', xlab="Age (years)",
# ylab = "f0 (Hz)",xlim=c(2,21),cex.axis=1.3,cex.lab=1.3)
# lines (aggdmu$age[aggdmu$gender=="m"]+.1,aggdmu$f0[aggdmu$gender=="m"],
# pch=16,col=4,lwd=2,cex=1.5,type='b')
# grid()
#
# phonTools::errorbars(aggdmu$age[aggdmu$gender=="f"]-.1,aggdmu$f0[aggdmu$gender=="f"],
# aggdsd$f0[aggdsd$gender=="f"]*2,col=2,lwd=1,length=0.051)
# phonTools::errorbars(aggdmu$age[aggdmu$gender=="m"]+.1,aggdmu$f0[aggdmu$gender=="m"],
# aggdsd$f0[aggdsd$gender=="m"]*2,col=4,lwd=1,length=0.051)
#
# plot (height_data$height[height_data$gender=="f"][-c(1,2,3,19)],
# aggdmu$f0[aggdmu$gender=="f"], pch=16,col=2,lwd=6,cex=2.75, ylim = c(50,350),
# type='b', xlab="Hieght (cm)", ylab = "f0 (Hz)",xlim=c(95,205),cex.axis=1.3,
# cex.lab=1.3)
# lines (height_data$height[height_data$gender=="m"][-c(1,2,3,19)],
# aggdmu$f0[aggdmu$gender=="m"],
# pch=16,col=4,lwd=6,cex=2.75,type='b')
# grid()
#
# count = 1
# for (i in (1:19)[-c(1,2,3,19)]){
# phonTools::sdellipse (
# matrix(c((height_data$sd[height_data$gender=="f"][count]),0,
# 0,(aggdsd$f0[aggdsd$gender=="f"][count]))^2,2,2),
# means = c(height_data$height[height_data$gender=="f"][i],
# aggdmu$f0[aggdmu$gender=="f"][count]), col = 2,lty=3)
#
# phonTools::sdellipse (
# matrix(c((height_data$sd[height_data$gender=="m"][count]),0,
# 0,(aggdsd$f0[aggdsd$gender=="m"][count]))^2,2,2),
# means = c(height_data$height[height_data$gender=="m"][i],
# aggdmu$f0[aggdmu$gender=="m"][count]), col = 4, lty=3)
#
# count = count + 1
# }
# dev.off()
```