Learn R Programming

geomorph (version 2.1.6)

advanced.procD.lm: Procrustes ANOVA and pairwise tests for shape data, using complex linear models

Description

The function quantifies the relative amount of shape variation explained by a suite of factors and covariates in a "full" model, after accounting for variation in a "reduced" model. Inputs are formulae for full and reduced models (order is not important), plus indication if means or slopes are to be comapred among groups, with appropriate formulae to define how they should be compared.

Usage

advanced.procD.lm(f1, f2, groups = NULL, slope = NULL, angle.type = c("r",
  "deg", "rad"), iter = 999, verbose = FALSE)

Arguments

f1
A formula for a linear model, containing the response matrix (e.g., y ~ x1 + x2)
f2
A formula for another linear model (e.g., ~ x1 + x2 + x3 + a*b) (f1 and f2 should be nested)
groups
A formula for grouping factors (e.g., ~ a, or ~ a*b)
slope
A formula with one covariate (e.g., ~ x3)
angle.type
A value specifying whether differences between slopes should be represented by vector correlations (r), radians (rad) or degrees (deg)
iter
Number of iterations for significance testing
verbose
A logical value specifying whether additional output should be displayed (see Value below)

Value

  • Function returns an ANOVA table of statistical results for model comparison: error df (for each model), SS, MS, F ratio, Z, and Prand. The following may also be returned.
  • Means.distPairwise distance between means, if applicable
  • LS.Means.distPairwise distance between LS means, if applicable
  • Prob.Means.distP-values for pairwise distances between means
  • Slopes.distPairwise distance between slope vectors (difference in amount of shape change), if applicable
  • Prob.Slopes.distP-values for pairwise distances between slopes
  • Slopes.correlationPairwise vector correlations between slope vectors, if applicable
  • Prob.Slopes.corP-values for pairwise correlations between slope vectors (high correlation less significant)
  • Slopes.angleAngles between between slope vectors, if applicable
  • Prob.Slopes.angleP-values for pairwise angles between slope vectors
  • SS.randRandom SS from RRPP permutations (when {verbose=TRUE})
  • random.mean.distrandom pairwise distances between means from RRPP permutations (when {verbose=TRUE})
  • random.slope.distrandom pairwise distances between slopes from RRPP permutations (when {verbose=TRUE})
  • random.slope.comprandom pairwise slope direction comparisons (r or angle) from RRPP permutations (when {verbose=TRUE})

Details

The response matrix 'y' can be in the form of a two-dimensional data matrix of dimension (n x [p x k]) or a 3D array (p x k x n). It is assumed that the landmarks have previously been aligned using Generalized Procrustes Analysis (GPA) [e.g., with gpagen]. The names specified for the independent (x) variables in the formula represent one or more vectors containing continuous data or factors. It is assumed that the order of the specimens in the shape matrix matches the order of values in the independent variables. The function performs statistical assessment of the terms in the model using Procrustes distances among specimens, rather than explained covariance matrices among variables. With this approach, the sum-of-squared Procrustes distances are used as a measure of SS (see Goodall 1991). The SS betwen models is evaluated through permutation. In morphometrics this approach is known as a Procrustes ANOVA (Goodall 1991), which is equivalent to distance-based anova designs (Anderson 2001). Unlike procD.lm, this function is strictly for comparison of two nested models. The function will readily accept non-nested models, but the results will not be meaningful. (Use of procD.lm will be more suitable in most cases.) A residual randomization permutation procedure (RRPP) is utilized for reduced model residuals to evalute the SS between models (Collyer et al. 2015). Effect-sizes (Z-scores) are computed as standard deviates of the SS sampling distributions generated, which might be more intuitive for P-values than F-values (see Collyer et al. 2015). Pairwise tests are only performed if formulae are provided to compute such results.

References

Collyer, M.L., D.J. Sekora, and D.C. Adams. 2015. A method for analysis of phenotypic change for phenotypes described by high-dimensional data. Heredity. 113: doi:10.1038/hdy.2014.75.

See Also

procD.lm

Examples

Run this code
data(plethodon)
Y.gpa<-gpagen(plethodon$land)    #GPA-alignment
Y<-two.d.array(Y.gpa$coords)
CS <- Y.gpa$Csize
sp<- plethodon$species
st<- plethodon$site

# Example of a nested model comparison (as with ANOVA with RRPP)
advanced.procD.lm(Y ~ log(CS) + sp, ~ log(CS)*sp*st, iter=19)

# Example of a test of a factor interaction, plus pairwise comparisons (replaces pairwiseD.test)
advanced.procD.lm(Y ~ st*sp, ~st + sp, groups = ~st*sp, iter=19)

# Example of a test of a factor interaction, plus pairwise comparisons,
# accounting for a common allomtry  (replaces pairwiseD.test)
advanced.procD.lm(Y ~ log(CS) + st*sp,
~log(CS) + st + sp,
groups = ~st*sp, slope = ~log(CS), iter=19)

# Example of a test of homogeneity of slopes, plus pairwise slopes comparisons
# (replaces pairwise.slope.test)
advanced.procD.lm(Y ~ log(CS)*st*sp,
~log(CS) + st*sp,
groups = ~st*sp, slope = ~log(CS), angle.type = "deg", iter=19)

# Example of partial pairwise comparisons, given greater model complexity
advanced.procD.lm(Y ~ log(CS)*st*sp,
~log(CS) + st*sp,
groups = ~sp, slope = ~log(CS), angle.type = "deg", iter=19)

Run the code above in your browser using DataLab