Be able to estimate measurement error and repeatability
Overview
Measurement Error and Repeatability
Morphometrics is all about assessing variability, within and between individuals. One of those sources of variability is measurement error.
Measurement Error (ME) itself comes from many potential sources:
the measurement device (precision)
definition of the measure
quality of the measured material
the measurer
the environment of the measurer (hopefully small!)
measurement protocol
We try to minimize ME so that we can reveal the underlying patterns we are interested in, but there will always be some ME. So it is important to quantify at least once at the beginning of the study.
Protocol for assessing ME
The percentage of measurement error is defined as the within-group component of variance divided by the total (within + betwee group) variance (Claude 2008):
We can get the componets of variance \(s^{2}\) from the mean squares (\(MSS\)) of an ANOVA considering the individual (as a factor) source of variation. Individual here represents the within-group variation. The among and within variance can be estimated from the mean sum of squares and \(m\) the number of repeated measurements:
Let’s say you are taking photographs of your specimens and you want to quantify the error assocated with placing your landmarks in the same place every time (i.e. is your criteria for the landmark robust enough that its obvious where it should be placed on each specimen, and if you came back to the data a month or year later?)
To assess measurement error in this instance we could take two sets of pictures, each time removing and positioning the specimen. And we could digitize each image twice, preferably in different sessions (another day or week). This would give us 4 sets of landmark data for each specimen, allowing us to asses both error associated with the digitization as well as error in capturing the shapes via the photographs.
Alternatively, if we were interested in inter-observer error vs. repeatability within observer, we could take one photograph and have it measured by two different people, each person taking two sets of measurements (preferably in different sessions).
Simulated example:
Repeat a set of five measurements, (measure twice), once in each of two sessions on different days. How repeatable are the measurements?
Simulate the data:
true_m<-rnorm(5,20,3)# true valuesm1<-true_m+rnorm(5,0,1)# measurements set 1m2<-true_m+rnorm(5,0,1)session<-gl(2, 5)individual<-as.factor(rep(1:5,2))total_m<-c(m1, m2)cbind(individual, total_m, session)# the data
And the percent measurement error is represented by pME. As a rough rule of thumb we want this to be less than 5%. If it is very high, we either want to practice more, or take multiple measurements of each variable and average them.
Calculating morphometric parameters
Your raw data may be in lengths for linear morphometrics or coordinate for landmark-based morphometrics. You will often have to calcuate quantities from your raw data such as distances and angles.
Calculating distances
You may need to calculate distances between your landmarks, or you may have species centroids (the means in multiple dimensions), and you want to know the distance between species in morphospace.
The distance between two points (in k dimensions) is given by the square root of the sum of the squared differences between the points.
This is analogous to calcuating the length of the hypotenuse in a right triangle. If there is more than one dimension, these squared differences are computed dimension by dimension, summed, then the entire quantity is square rooted.
distance<-function(A, B){sqrt(sum((A-B)^2))}distance(A, B)
[1] 6.403124
Try it on a 3-D set of coordinates. Does it work?
Angle between two vectors
The angle \(\theta\) between two vectors \(\overrightarrow{AB}\) and \(\overrightarrow{CD}\) can be calculated using the dot product and the rule of cosines.
Suppose we have two vectors \(V_1 = (x_1,y_1)\), and \(V2 = (x_2,y_2)\). We can use our coordinates A, B above to calculate our first vector, and make up a second one. From geometry, we can think of vectors as originating at (0,0) with the vector coordinates indicating the head of the vector.
Where the result is in radians, not degrees (see the help page ?acos, all of Rʻs trig functions are in radians).
Note: I should change this to using the arc tangent, to preserve the angle in case it is outside of 0,pi.
Radians to degrees
Degrees and radians are different units of measure for an angle. To covert to degrees, remember that a 360 degree circle is 2pi radians (or a half circle 180 degrees is pi radians):
To remember how to do this conversion, recall that the formula for the circumference of a circle is:
\[
Circumference = 2 \pi r
\]
A few key facts:
Arc length : the distance along a curved line (the arc length of the entire circle is the circumference).
Radian : the angle measured in relation to the radius. If you take the radius and lay it along the circle, the angle defined by the arc length of one radius is one radian.
To complete the circle, we need an arc length of \(2\pi r\) (which is the circumferemce), or a little over 6 radians (because \(2\pi ~= 6\)).
Degrees : another unit of measure for angles, defined by one circle having 360 degrees.
Therefore, the angle of a full circle is \(360^\circ\), or equivalently, \(2\pi\) radians:
\(180^\circ = \pi\) radians
If we take a measurement M in radians: \[
M (rad)\frac{180^\circ}{\pi rad} = (M\frac{180}{\pi} )^\circ
\]
theta_degrees<-theta/pi*180theta_degrees
[,1]
[1,] 24.77514
References
Claude, Julien. 2008. Morphometrics with r. 1. Aufl. New York, NY: Springer-Verlag.