class: center, middle, inverse, title-slide .title[ # 10: Repeated Shape Measures: Symmetry, Asymmetry and Measurement Error ] .subtitle[ ## Multiple shape observations performed on the same research subjects ] .author[ ### ] --- <style type="text/css"> pre { max-width: 100%; overflow-x: scroll; } .scrollable { height: 80% !important; overflow-y: auto !important; } .remark-slide-content { font-size: 20px; padding: 20px 80px 20px 80px; } .remark-code, .remark-inline-code { background: #f0f0f0; } .remark-code { font-size: 20px; } .huge .remark-code { /*Change made here*/ font-size: 200% !important; } .med .remark-code { /*Change made here*/ font-size: 75% !important; } .small .remark-code { /*Change made here*/ font-size: 50% !important; } .small2 .remark-code { /*Change made here*/ font-size: 45% !important; } .tiny .remark-code { /*Change made here*/ font-size: 35% !important; } </style> ### Within-subject shape variation + For most statistical applications, an assumption of **independent observations** is implicit. This generally means that a research subject (specimen, organism, species) has a single landmark configuration from which its shape can be compared to others. + Some studies (usually experimental in nature) require multiple measurements (digitizations) per subject. If multiple measurements are made, they cannot be treated as independent observations. + The *Phylogenetic Comparative Methods* lecture addressed non-independent observations one way (generalized least squares estimation, GLS). This lecture will focus on (some of) the cases where non-independence is more so because of **repeated shape measures**. + A simple but not universal way to remember the subtle difference is that non-independence because of inherit relatedness among subjects is a challenge for **estimation** (requires GLS estimation). Non-independence because of repeated measures is a challenge for **evaluation** (requires alteration of inferential methods). Both challenges can arise in the same data set. --- ### Within-subject shape variation (cont.) and Overview + There are particularly two cases for which repeated shape measures on the same research subjects are common: + Shape analysis on (typically) bilaterally symmetric organisms, requiring two landmark configurations of left and right structures, or one configuration that could be divided into left and right sub-configurations. Analyses typically assess the **symmetry** found between left and right pairs of configurations, and evaluate whether there is a pattern of **asymmetry**. -- + Shape analysis concerned with the precision of shape estimation, and whether there are inherent tendencies to digitize configurations in different way on the same research subjects. Such experimental designs and their analyses seek to understand the propensity for **measurement error**. -- + Other cases that require repeated shape measurements could be imagined: + Ontogenetic shape variation (if the same landmark configuration could be digitized on the same organisms over developmental time). This would be a special case of allometry. + Dose-response experiments that evaluate shape change over time after an experimental treatment. + Hierarchical analyses that involve, e.g., multiple individuals within species, as well as many species, with the subject level equal to species. -- + However, these other cases really just are different reasons for similar data analysis, using a **within-subject RRPP** philosophy. --- ### Symmetry and Asymmetry + Many objects are built symmetrically + Paired structures and serially homologous body parts are organized in a symmetric way -- + Bilateral symmetry: structures arranged in either side of the body mid-line (axis of symmetry) + Symmetry poses some challenges for morphometric data analysis --- ### Types of Bilateral Symmetry - Two main types of bilateral symmetry: - **Matching symmetry**: pairs of structures are found across the mid-line of the object (e.g. insect wings, tetrapod limbs etc) - **Object symmetry**: single structure with internal structural symmetry (e.g. structures in vertebrate skull) <img src="LectureData/10.asymmetry/SymmTypes.png" width="100%" style="display: block; margin: auto;" /> --- ### The Problem with Symmetrical Objects + Landmark positions are not independent in symmetric objects + Lack of statistical independence for paired landmarks + Some dimensions of shape space have little variance + SSCP matrices become singular (or nearly so) + This causes issues with parametric statistical hypothesis-testing methods ('divide' by zero or nearly so) <img src="LectureData/10.asymmetry/SymmLizard.png" width="40%" style="display: block; margin: auto;" /> -- + The problem becomes more acute as objects become more symmetrical! --- ### The Problem with Symmetrical Objects (Cont.) + The data in reality have fewer dimensions, so use less data. How? + Digitize only half structure + Reflect structure and take the average: make a symmetrical structure + Using only `\(\frac{1}{2}\)` structure has challenges: + Does not represent entire shape + Can introduce assymetries because the midline is not 'anchored' during the analysis + Solution: use **entire structure** and **RRPP** for statistical evaluation! ###### As we've seen this week, RRPP, combined with robust summary test statistics, does not require inverting (nearly) singular covariance matrices, so model evaluation is not compromised by this issue. --- ### Symmetric Objects: Example + Note the large number of shape dimensions with no variation. Much of this is due to bilateral symmetry! .scrollable[ ``` ## ## No curves detected; all points appear to be fixed landmarks. ``` <img src="10-RepeatedShapeMeasures_files/figure-html/unnamed-chunk-4-1.png" width="80%" style="display: block; margin: auto;" /> ``` ## Importance of components: ## PC1 PC2 PC3 PC4 PC5 PC6 ## Standard deviation 0.02167 0.01764 0.01354 0.01115 0.009989 0.008932 ## Proportion of Variance 0.27485 0.18198 0.10735 0.07272 0.058380 0.046680 ## Cumulative Proportion 0.27485 0.45683 0.56418 0.63690 0.695290 0.741960 ## PC7 PC8 PC9 PC10 PC11 PC12 ## Standard deviation 0.00823 0.007665 0.006262 0.005993 0.00541 0.005021 ## Proportion of Variance 0.03964 0.034380 0.022940 0.021010 0.01713 0.014750 ## Cumulative Proportion 0.78160 0.815980 0.838920 0.859940 0.87706 0.891810 ## PC13 PC14 PC15 PC16 PC17 PC18 ## Standard deviation 0.004777 0.004682 0.004486 0.00432 0.004139 0.003805 ## Proportion of Variance 0.013350 0.012830 0.011780 0.01092 0.010020 0.008470 ## Cumulative Proportion 0.905170 0.918000 0.929770 0.94069 0.950710 0.959180 ## PC19 PC20 PC21 PC22 PC23 PC24 ## Standard deviation 0.00354 0.003408 0.003317 0.003162 0.003013 0.002664 ## Proportion of Variance 0.00733 0.006800 0.006440 0.005850 0.005310 0.004150 ## Cumulative Proportion 0.96652 0.973310 0.979750 0.985600 0.990910 0.995070 ## PC25 PC26 PC27 PC28 PC29 PC30 ## Standard deviation 0.00242 0.001605 3.622e-15 3.49e-15 3.463e-15 3.294e-15 ## Proportion of Variance 0.00343 0.001510 0.000e+00 0.00e+00 0.000e+00 0.000e+00 ## Cumulative Proportion 0.99849 1.000000 1.000e+00 1.00e+00 1.000e+00 1.000e+00 ## PC31 PC32 PC33 PC34 PC35 PC36 ## Standard deviation 3.232e-15 3.173e-15 3.11e-15 3.042e-15 3.02e-15 2.99e-15 ## Proportion of Variance 0.000e+00 0.000e+00 0.00e+00 0.000e+00 0.00e+00 0.00e+00 ## Cumulative Proportion 1.000e+00 1.000e+00 1.00e+00 1.000e+00 1.00e+00 1.00e+00 ## PC37 PC38 PC39 PC40 PC41 ## Standard deviation 2.919e-15 2.871e-15 2.797e-15 2.747e-15 2.724e-15 ## Proportion of Variance 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 ## Cumulative Proportion 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.000e+00 ## PC42 PC43 PC44 PC45 PC46 ## Standard deviation 2.697e-15 2.64e-15 2.616e-15 2.565e-15 2.55e-15 ## Proportion of Variance 0.000e+00 0.00e+00 0.000e+00 0.000e+00 0.00e+00 ## Cumulative Proportion 1.000e+00 1.00e+00 1.000e+00 1.000e+00 1.00e+00 ## PC47 PC48 PC49 PC50 PC51 ## Standard deviation 2.494e-15 2.418e-15 2.386e-15 2.281e-15 2.204e-15 ## Proportion of Variance 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 ## Cumulative Proportion 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.000e+00 ## PC52 PC53 PC54 PC55 PC56 ## Standard deviation 2.163e-15 1.439e-15 1.364e-15 1.753e-16 1.932e-17 ## Proportion of Variance 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 ## Cumulative Proportion 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.000e+00 ``` ] --- ### The Biology of Asymmetry + Different types of asymmetry are thought to have a biological meaning + **Directional asymmetry**: consistent difference skewed towards one of the sides (at the population level); thought to reflect difference in use, e.g. fiddler crabs feeding vs. fighting displays <img src="LectureData/10.asymmetry/FiddlerCrab.png" width="40%" style="display: block; margin: auto;" /> -- + **Fluctuating asymmetry**: thought to reflect instability during development (genetic, environmental etc) + Long debate about the meaning of FA --- ### Types of Symmetry + Perfect symmetry is rare in biology; objects nearly always have some degree of asymmetry + Three main types of asymmetry have been described, based on the statistical distribution of asymmetry in the population -- + **1: Directional**: consistent `\(\small{(R-L)}\)` differences with one side always larger than the other: `\(\small{\overline{(R-L)}\neq0}\)` + **2: Fluctuating**: small random `\(\small{(R-L)}\)` deviations with `\(\small{\overline{(R-L)}=0}\)` + **3: Antisymmetry**: consistent `\(\small{(R-L)}\)` differences, but larger side random <img src="LectureData/10.asymmetry/SymmTypesHist.png" width="70%" style="display: block; margin: auto;" /> --- ### Analysis of Symmetry: General Procedure + The presence of various types of asymmetry may be evaluated using one of several factorial ANOVA designs + Traits need to be quantified multiple times, so that measurement error may be quantified + This allows one to evaluate if the (normally small) differences between sides are actually “real” or due to measurement error (ME) -- + ANOVA then often set up as: <img src="LectureData/10.asymmetry/AnovaDesign.png" width="70%" style="display: block; margin: auto;" /> --- ### Extensions to GM Shape Data <img src="LectureData/10.asymmetry/ReflectObjects.png" width="70%" style="display: block; margin: auto;" /> + **Procedure** + 1: Digitize right and left structures (or R and L sides), possibly multiple times for ME + 2: Reflect one side to match the other (and relabel landmarks for object symmetry) + 3: GPA + projection to tangent space + 4: Factorial ANOVA – SS for Individual, SS Side (DA), SS Side x Individual (FA) + 5: Assess model factors via permutation approaches ###### Klingenberg & McIntyre (1998). *Evolution.*; Klingenberg et al. (2002). *Evolution.* --- ### Decomposition of Asymmetry Component + One can approach the problem more theoretically (rather than 'procedurally') + ANOVA effects represent Sums of Squares, which correspond to various asymmetry components + Therefore, decomposing SST (total shape variation) obtained via `\(\small{D}_{Proc}\)` provides variance components for both DA and FA `$$\small{SST}=\sum^n_1{D}^2_{(X_i,Y_i)}=nD^2_{(\overline{X},\overline{Y})}+\sum^n_1{D}^2_{(X_i-\overline{X},Y_i-\overline{Y})}$$` -- + where: `\(\small{nD}^2_{(\overline{X},\overline{Y})}\)` represents the **Directional Asymmetry** component + and: `\(\small\sum^n_1{D}^2_{(X_i-\overline{X},Y_i-\overline{Y})}\)` represents the **Fluctuating Asymmetry** component ###### Mardia et al. (2000). *Biometrika*. --- ### Matching Symmetry: Example <img src="LectureData/10.asymmetry/MatchExWings.png" width="60%" style="display: block; margin: auto;" /> --- ### Matching Symmetry: Example 2 .scrollable[ ``` r data(mosquito) Y.gpa <- gpagen(mosquito$wingshape, print.progress = FALSE) plot(Y.gpa) ``` <img src="10-RepeatedShapeMeasures_files/figure-html/unnamed-chunk-10-1.png" width="60%" style="display: block; margin: auto;" /> ] --- ### Matching Symmetry: Example 2 (Cont.) .scrollable[.med[ ``` r mosquito.sym <- bilat.symmetry(A = Y.gpa, ind = mosquito$ind, side=mosquito$side, replicate = mosquito$replicate, object.sym = FALSE, print.progress = FALSE) summary(mosquito.sym) ``` ``` ## ## Call: ## bilat.symmetry(A = Y.gpa, ind = mosquito$ind, side = mosquito$side, ## replicate = mosquito$replicate, object.sym = FALSE, print.progress = FALSE) ## ## ## ## Symmetry (data) type: Matching ## ## Type I (Sequential) Sums of Squares and Cross-products ## Randomized Residual Permutation Procedure Used ## 1000 Permutations ## ## Shape ANOVA ## Df SS MS Rsq F Z Pr(>F) ## ind 9 0.104888 0.0116542 0.45533 2.6901 1.53968 0.061 . ## side 1 0.003221 0.0032209 0.01398 0.7435 -0.47265 0.681 ## ind:side 9 0.038990 0.0043323 0.16926 1.0407 0.27074 0.390 ## ind:side:replicate 20 0.083259 0.0041629 0.36143 ## Total 39 0.230358 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## ## Centroid Size ANOVA ## Df SS MS Rsq F Z Pr(>F) ## ind 9 4.1496e-09 4.6107e-10 0.18555 0.8452 -0.21501 0.592 ## side 1 3.4740e-10 3.4738e-10 0.01553 0.6368 0.22428 0.437 ## ind:side 9 6.9569e-09 7.7299e-10 0.31108 1.4170 0.70241 0.237 ## ind:side:replicate 20 1.0910e-08 5.4549e-10 0.48784 ## Total 39 2.2364e-08 ``` ]] --- ### Matching Symmetry: Example 2 (Cont.) .scrollable[ ``` r plot(mosquito.sym, warpgrids = TRUE) ``` <img src="10-RepeatedShapeMeasures_files/figure-html/unnamed-chunk-12-1.png" width="80%" style="display: block; margin: auto;" /> ] --- ### Object Symmetry: Example <img src="LectureData/10.asymmetry/ObjExLizards.png" width="80%" style="display: block; margin: auto;" /> --- ### Object Symmetry: Example 2 .scrollable[.med[ ``` r data('lizards') Y.gpa <- gpagen(lizards$coords, print.progress = FALSE) plot(Y.gpa) ``` <img src="10-RepeatedShapeMeasures_files/figure-html/unnamed-chunk-14-1.png" width="60%" style="display: block; margin: auto;" /> ]] --- ### Object Symmetry: Example 2 (Cont.) .scrollable[ ``` r lizard.sym <- bilat.symmetry(A = Y.gpa, ind = lizards$ind, replicate = lizards$rep, object.sym = TRUE, land.pairs = lizards$lm.pairs, print.progress = FALSE) summary(lizard.sym) ``` ``` ## ## Call: ## bilat.symmetry(A = Y.gpa, ind = lizards$ind, replicate = lizards$rep, ## object.sym = TRUE, land.pairs = lizards$lm.pairs, print.progress = FALSE) ## ## ## ## Symmetry (data) type: Object ## ## Type I (Sequential) Sums of Squares and Cross-products ## Randomized Residual Permutation Procedure Used ## 1000 Permutations ## ## Shape ANOVA ## Df SS MS Rsq F Z Pr(>F) ## ind 48 0.236788 0.0049331 0.83194 7.3721 -0.1011 0.536 ## side 1 0.009432 0.0094317 0.03314 14.0951 3.7540 0.001 *** ## ind:side 48 0.032119 0.0006692 0.11285 10.4367 19.7078 0.001 *** ## ind:side:replicate 98 0.006283 0.0000641 0.02208 ## Total 195 0.284622 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ``` ] --- ### Object Symmetry: Example 2 (Cont.) .scrollable[ ``` r plot(lizard.sym, warpgrids = TRUE) ``` <img src="10-RepeatedShapeMeasures_files/figure-html/unnamed-chunk-16-1.png" width="80%" style="display: block; margin: auto;" /> ] --- ### Other Types of Asymmetry + Many other types of (a)symmetry are present in biological data + How can we quantify asymmetry for these structures? <img src="LectureData/10.asymmetry/HigherSymm.png" width="70%" style="display: block; margin: auto;" /> --- ### Symmetry Groups + One can approach the problem by defining **Symmetry Groups** + Symmetry groups: transformations that leave the data invariant + e.g.: bilateral symmetry = reflection across the midline <img src="LectureData/10.asymmetry/SymmGroups.png" width="40%" style="display: block; margin: auto;" /> + Symmetry groups define transformations such that there are invariances in those symmetric 'dimensions' + These groups describe the ways in which symmetry can be defined, and thus quantified for more complex structures (e.g., radial symmetry) ###### Savriama and Klingenberg. (2011). *BMC Evol. Biol.* --- ### Symmetry: Extended Protocol .pull-left[ + For bilateral asymmetry: transformation = reflection + For other types, decompose asymmetry to the components defining the symmetry type based on the appropriate symmetry groups + Example: Rotational Symmetry + Digitize all p components + GPA + projection + Decompose shape variation into symmetry components, quantify and evaluate ] .pull-right[ <img src="LectureData/10.asymmetry/RadialSymm.png" width="50%" style="display: block; margin: auto;" /> ] ###### Savriama and Klingenberg. (2011). *BMC Evol. Biol.* --- ### Complex Symmetry: Example + Symmetry Analysis in corals <img src="LectureData/10.asymmetry/CoralSymmetry.png" width="70%" style="display: block; margin: auto;" /> --- ### Symmetry: Summary + Symmetry causes redundancy in shape data + Can account for symmetry effects analytically + Asymmetry: biological significance + FA: developmental instability + DA: adaptation? + Use ANOVA procedures to separate variation within (asymmetry) and among individuals + Extensions to different types of symmetry --- ### Important Notes! + An implicit (but not required) assumption in the previous analyses was that Type I SSCP was appropriate. This is a good idea because analysis first accounts for variation at the subject level, then at the side level after accounting for individual variation, then at the individual:side level after accounting for both individual and side variation. -- + This might make sense for symmetry analyses. The experimental design (all symmetry analyses are experiments in the sense that fixed treatments are applied to each subject for left and right measurements, even if the study is observational) seeks to understand **the amount and nature of asymmetry in comparison to measurement error (ME)**. -- + For such analyses, ME is noise. It helps to have a basis for asymmetry between left and right sides by having an understanding of how variable the left or right side would be if digitized twice or more; i.e., a baseline for expected digitizing noise. --- ### Important Notes! + But what if the replicated measures for ME also have a pattern? + Digitizations between two different people + Digitizations using different scanners + Digitizations made without a random ordering of observations; e.g., all left sides digitized first then all right sides. -- + Sometimes a pattern of shape change within subjects should be analyzed. + Maybe a preliminary experiment to ascertain whether multiple researchers, devices, or digitizing protocol introduces a bias or prejudice. --- ### Measurement Error (ME): An example of within-subject shape analysis .pull-left[ + ME first discussed for shape analysis in 1998. `\(^1\)` + ME revisited 2016-2017, but no new developments were made (just an emphasis for why it is important and how it could be done). `\(^{2-3}\)` + There was a "spirited" debate on Morphmet in November, 2022, about measurement error (some of you might recall) and it became clear that the topic needed to be modernized. + The prevailing issue (as we see it) was that most people were using techniques that basically measured: replicate variation / subject variation. (More specifically, statistics like intraclass correlations.) ] .pull-right[ + **This is a problem because if one samples diversely shaped subjects (e.g., many species rather than many individuals within one species), one could labor under the delusion that ME is small, simply because between-subject variation is large.** + **This is also a problem because it treats all ME as random (noise), even if systematic digitizing prejudices are inherent in the data.** + The following is our fixing of these problems, just published this year. `\(^4\)`. ] .footnote[ `\(^1\)` Arnqvist, G., & Mårtensson, T. (1998); `\(^2\)` Fruciano, C. (2016); `\(^3\)` Fruciano, C., et al. (2017); `\(^4\)` Collyer, M.L., & Adams, D.C. (2024). ] --- ### Measurement Error (ME) via within-subject RRPP + ANOVA/MANOVA components (can be done with either an ANOVA or MANOVA framework): | Source | Based on | Comment |:------- | :----------- | :----------------------------- |Subjects| Sampling of different research subjects| Choosing diverse subjects is a good thing, and cannot arbitrarily influence analysis of ME.| |Systematic ME|Replicates|This is variation that is **systematic**, perhaps because of digitizer, timing, or some other method that could introduce a **digitizing prejudice**.| |Systematic ME:Groups|Strata for subject sampling|*An optional* component if it is known that subjects are sampled from different groups that might have different shapes. This allows one to evaluate if systematic ME is associated with certain groups or differs among groups.| |Random ME|Residual variation|Differences between replicates but do not have a replicated pattern. This is **noise**. Total ME (systematic + random) is not noise.| + This might look like a symmetry/asymmetry analysis (subjects = individuals, systematic ME = side), but that is not quite right. Rather, Groups = side would be more appropriate and in symmetry/asymmetry, ME = systematic + random ME. Also, the inferential methods are different (more in a moment). --- ### Measurement Error (ME) via within-subject RRPP (Cont.) The following is a simplified summary: + Statistics and statistics to avoid: + `\(\eta^2\)`; e.g., `\(\eta^2_{Syst.ME} = \frac{SS_{Syst.ME}}{SS_{Total.ME}}\)` but not `\(R^2_{Syst.ME} = \frac{SS_{Syst.ME}}{SS_{Total}}\)`. The latter can be really small just because subject variation is large. **This has been historically evaluated, but is misleading.** + Signal (Systematic ME) to Noise (Random ME) ratio `\((SNR)\)`; e.g., `\(SNR = \frac{SS_{Syst.ME}}{SS_{Random.ME}}\)`. + The former is like a relative risk, varying between 0 and 1; the latter is like an odds ratio, expressing how many more times prevalent is systematic ME than random ME. + Intraclass correlation coefficient `\((ICC)\)`; e.g., `\(ICC = \frac{MS_S-MS_W}{MS_S + (r-1)MS_W}\)`, for variance `\((MS)\)` among subjects `\((S)\)` and within subjects `\((W)\)`, for `\(r\)` replicates, **should be avoided!**. `\(ICC\)` measures how reliable subjects are for measurement and can be inflated by sampling more diverse subjects; it does not measure any systematic pattern among replicates. --- ### Measurement Error (ME) via within-subject RRPP (Cont.) + The important aspect of ME analysis is how RRPP is utilized. Analysis of ME components is performed by restricting RRPP to be within subjects. **This means that inter-subject variation is held constant over every RRPP permutation!** No confounding of subject and ME effects. + Type II SSCP is used for ME effects (accounts for inter-subject variation, but does not conflate it with ME effects.) + Type III SSCP is used for subjects test. This is not really a focus of the analysis, but it can be done to know how variable subject shapes were. + `\(SNR\)` eigenvectors (eigenvectors of the inverse of the random ME SSCP times the systematic ME SSCP) can be used to visualize ME issues. + All statistical properties are vetted in detail in Collyer and Adams (2024). --- ### Measurement Error (ME) Example: how to do it in `geomorph` Using simulated data from Collyer and Adams (2024) .scrollable[ ``` r data(fishy) fishy$coordsarray <- arrayspecs(fishy$coords, p = 11, k = 2) #make 3D array # Example two digitization replicates of the same research subjects rep1 <- matrix(fishy$coords[1,], 11, 2, byrow = TRUE) rep2 <- matrix(fishy$coords[61,], 11, 2, byrow = TRUE) plot(rep1, pch = 16, col = gray(0.5, alpha = 0.5), cex = 2, asp = 1, xlab = "x", ylab = "y") points(rep2, pch = 16, col = gray(0.2, alpha = 0.5), cex = 2, asp = 1) ``` ![](10-RepeatedShapeMeasures_files/figure-html/unnamed-chunk-21-1.png)<!-- --> ] --- ### Measurement Error (ME) Example: how to do it in `geomorph` (Cont.) **Analysis unconcerned with groups from which subjects are sampled** .scrollable[ ``` r ME1 <- gm.measurement.error( coords = "coordsarray", subjects = "subj", replicates = "reps", data = fishy) anova(ME1) ``` ``` ## ## Analysis of Variance, using Residual Randomization ## Permutation procedure: Randomization of null model residuals ## Number of permutations: 1000 ## Estimation method: Ordinary Least Squares ## Sums of Squares and Cross-products: Type Within-subject II ## Effect sizes (Z) based on SNR distributions ## ## Df SS MS Rsq EtaSq.ME SNR Z Pr(>SNR) ## Subjects 59 1.20209 0.0203744 0.96941 34.453 20.6317 0.001 ## Systematic ME 1 0.00303 0.0030348 0.00245 0.08002 0.087 4.5374 0.001 ## Random ME 59 0.03489 0.0005914 0.02814 0.91998 ## Total 119 1.24002 ## ## Subjects *** ## Systematic ME *** ## Random ME ## Total ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## Call: Y ~ subjects + replicates ``` ``` r plot(ME1) ``` ![](10-RepeatedShapeMeasures_files/figure-html/unnamed-chunk-22-1.png)<!-- --> ] --- ### Measurement Error (ME) Example: how to do it in `geomorph` (Cont.) **Analysis concerned with groups from which subjects are sampled**. Some groups have longer tails. .scrollable[ ``` r ME2 <- gm.measurement.error( coords = "coordsarray", subjects = "subj", replicates = "reps", groups = "groups", data = fishy) anova(ME2) ``` ``` ## ## Analysis of Variance, using Residual Randomization ## Permutation procedure: Randomization of null model residuals ## Number of permutations: 1000 ## Estimation method: Ordinary Least Squares ## Sums of Squares and Cross-products: Type Within-subject II ## Effect sizes (Z) based on SNR distributions ## ## Df SS MS Rsq EtaSq.ME SNR Z ## Subjects 59 1.18779 0.0201320 0.95788 39.534 17.7458 ## Systematic ME 1 0.00303 0.0030348 0.00245 0.08002 0.101 4.6930 ## Systematic ME:Groups 2 0.00485 0.0024231 0.00391 0.12778 0.161 6.5764 ## Random ME 57 0.03004 0.0005271 0.02423 0.79220 ## Total 119 1.24002 ## Pr(>SNR) ## Subjects 0.001 *** ## Systematic ME 0.001 *** ## Systematic ME:Groups 0.001 *** ## Random ME ## Total ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## Call: Y ~ subjects + groups * replicates ``` ``` r plot(ME2) ``` ![](10-RepeatedShapeMeasures_files/figure-html/unnamed-chunk-23-1.png)<!-- -->![](10-RepeatedShapeMeasures_files/figure-html/unnamed-chunk-23-2.png)<!-- -->![](10-RepeatedShapeMeasures_files/figure-html/unnamed-chunk-23-3.png)<!-- --> ] --- ### Measurement Error (ME) Example: how to do it in `geomorph` Comments: + Data were simulated to have a *digitizing prejudice* such that longer-tailed fish were digitized in a way that exacerbates their tail lengths (as if a person might tend to make longer-tailed fish have long tails as an instinct). + The analysis was able to determine that not only was there a significant systmatic ME, but it was differently pronounced among groups from which fish were sampled. + Perhaps not obvious in this example (but explored in Collyer and Adams 2024) is that the same digitizing prejudice applied to specimens from different groups can produce a significant `Systematic ME:Groups` effect. + A systematic digitizing prejudice `\(\neq\)` a systematic shape difference! + For example, a digitizer that tends to make tails longer, both for short- and long-tailed species, will induce larger relative tail growth for the short-tailed species than the long-tailed species. + The analysis is able to reveal both a magnitude and directional shape change for specific subjects. See next example. --- ### Measurement Error (ME) Example: Re-evaluating Fruciano et al. (2017) + Background: The original study was conducted to examine the effects of combining landmark data from multiple observers and scanning devices. + 3D landmark data obtained from the crania of 23 marsupial species. + Three types of surface scans, each by two observers + 23 species, two clades and an outgroup, 24 landmarks digitized on each, six replicates. <img src="LectureData/10.asymmetry/fruciano_fig7ab.png" width="70%" style="display: block; margin: auto;" /> --- ### Measurement Error (ME) Example: Re-evaluating Fruciano et al. (2017) (Cont.) + Performed ANOVA with ME protocol + Performed MAONVA with ME Protocol + Visualized patterns + Reconcile results and new conclusions with previous conclusions. .pull-left[ **ANOVA** <img src="LectureData/10.asymmetry/fruciano_tab4.png" width="100%" style="display: block; margin: auto;" /> ] .pull-right[ **MANOVA** <img src="LectureData/10.asymmetry/fruciano_tab5.png" width="90%" style="display: block; margin: auto;" /> ] --- ### Measurement Error (ME) Example: Re-evaluating Fruciano et al. (2017) (Cont.) .pull-left[ <img src="LectureData/10.asymmetry/fruciano_fig7cd.png" width="100%" style="display: block; margin: auto;" /> ] .pull-right[ <img src="LectureData/10.asymmetry/fruciano_fig7ef.png" width="100%" style="display: block; margin: auto;" /> ] --- ### Measurement Error (ME) Example: Re-evaluating Fruciano et al. (2017) (Cont.) .scrollable[ <img src="LectureData/10.asymmetry/fruciano_fig7ef.png" width="100%" style="display: block; margin: auto;" /> ] --- ### Measurement Error (ME) Example: Re-evaluating Fruciano et al. (2017) (Cont.) **Results that were consistently found from both analyses (Fruciano et al. 2017 and Collyer & Adams 2024):** + Operators has some digitizing differences. + Scanners had some digitizing differences. + Results could not be interpreted independently of phylogeny. **Results that were only found with new ME approach by Collyer & Adams (2024):** + Systematic ME was a large effect (not small) when accounting for variation among species (subjects). + A systematic ME:clade effect was also significant and a strong effect. The divergence in estimates because of the combination of operator and scanner was not consistent between clades. + The `PH` method of scanning was especially prone to operator prejudices, but the prejudice varied among subjects. + ***Results helped pinpoint areas where issues could be addressed!*** --- ### Measurement Error: Summary + Replicated shape measures cause redundancy in shape data, but in the case of ME, it is not an artifact to confront but potential patterns to explore. + ANOVA/MANOVA not really new, but **within-subject RRPP** is a new essential step. + Better statistics in terms of conveying useful and interpretable information. + Visualization tools can help identify areas of concern that could be fixed. --- ### Repeated Shape Measures: Summary + This is probably still a nascent field and one that will grow fast. + Within-subject RRPP opens the door for so many more analytical possibilities + One possibility will be discussed in Lecture 14: Expanded-PGLS + Mixed-model RRPP is a new frontier. + This is a fast-evolving sub-discipline!