trajectory.analysis(f1, data = NULL,
estimate.traj = TRUE, traj.pts = NULL, iter = 99)
two.d.array
can be used to obtain a
two-dimensional data matrix from a 3D array of landmark
coordinates. It is assumed that the order of the
specimens 'Y' matches the order of specimens in 'X'.
There are two primary modes of analysis through this
function. If "estimate.traj=TRUE" the function estimates
shape trajectories using the least-squares means for
groups, based on a two-factor model (e.g., Y~A+B+A:B).
Under this implementation, the last factor in 'X' must be
the interaction term, and the preceding two factors must
be the effects of interest. Covariates may be included in
'X', and must precede the factors of interest (e.g.,
Y~cov+A*B). In this implementation, 'Y' contains a matrix
of landmark coordinates. It is assumed that the landmarks
have previously been aligned using Generalized Procrustes
Analysis (GPA) [e.g., with gpagen
].
If "estimate.traj=FALSE" the trajectories are assembled
directly from the set of shapes provided in 'Y'. With
this implementation, the user must specify the number of
shapes that comprise each trajectory. This approach is
useful when the set of shapes forming each trajectory
have been quantified directly (e.g., when motion paths
are compared: see Adams and Cerney 2007). With this
implementation, variation in trajectory size, shape, and
orientation are evaluated for each term in 'X'.(see Adams
and Cerney 2007).#1: Estimate trajectories from LS means in 2-factor model
data(plethodon)
Y.gpa<-two.d.array(gpagen(plethodon$land)$coords) #GPA-alignment coords in 2D array
trajectory.analysis(Y.gpa~plethodon$species*plethodon$site,iter=15)
#2: Compare motion trajectories
data(motionpaths)
#Motion paths represented by 5 time points per motion
trajectory.analysis(motionpaths$trajectories~motionpaths$groups,estimate.traj=FALSE, traj.pts=5,iter=15)
Run the code above in your browser using DataLab