{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Principal Components Analysis: Crabs data Example\n", "\n", "Campbell (1974) studied rock crabs of the genus _leptograpsus_. One species, _L. variegatus_, had been split into two new species according to their colour: orange and blue. Preserved specimens lose their colour, so it was hoped that morphological differences would enable museum material to be classified.\n", "Data are available on 50 specimens of each sex of each species. Each specimen has measurements on:\n", "\n", "* the width of the frontal lobe `FL`,\n", "* the rear width `RW`, \n", "* the length along the carapace midline `CL`, \n", "* the maximum width `CW` of the carapace, and \n", "* the body depth `BD` in mm.\n", "\n", "in addition to colour/species and sex (we will treat the problem as unsupervised and will ignore these for now)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true, "slideshow": { "slide_type": "skip" }, "tags": [ "jupyter:kill_input" ] }, "outputs": [], "source": [ "#header to make the figures look pretty\n", "options(repr.plot.width=5, repr.plot.height=5)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false, "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "
FL | RW | CL | CW | BD | |
---|---|---|---|---|---|
12 | 12.3 | 11.0 | 26.8 | 31.5 | 11.4 |
2 | 8.8 | 7.7 | 18.1 | 20.8 | 7.4 |
8 | 11.6 | 9.1 | 24.5 | 28.4 | 10.4 |
39 | 17.1 | 12.7 | 36.7 | 41.9 | 15.6 |
43 | 18.0 | 13.7 | 39.2 | 44.4 | 16.2 |
49 | 19.8 | 14.3 | 42.4 | 48.9 | 18.3 |