match.layers.x.runs {conStruct} | R Documentation |
Match layers up across independent conStruct runs
Description
match.layers.x.runs
Usage
match.layers.x.runs(admix.mat1, admix.mat2, admix.mat1.order = NULL)
Arguments
admix.mat1 |
A |
admix.mat2 |
A |
admix.mat1.order |
An optional |
Details
This function takes the results of two independent
conStruct
analyses and compares them to identify
which layers in a new analysis correspond most closely
to the layers from an original analysis.
This function compares admixture proportions in layers across
independent conStruct
runs, and compares between them to
identify the layers in admix.mat2
that correspond most
closely to those in admix.mat1
. It then returns a vector
giving an ordering of admix.mat2
that matches up the order
of the layers that correspond to each other. This can be useful
for:
Dealing with "label switching" across independent runs with the same number of layers;
Plotting results from independent runs with different numbers of layers using consistent colors (e.g., the "blue" layer shows up as blue even as
K
increases);Examining results for multimodality (i.e., multiple distinct solutions with qualitatively different patterns of membership across layers).
The admix.mat1.order
argument can be useful when running
this function to sync up plotting colors/order across the output
of more than two conStruct
runs.
Value
This function returns a vector
giving the ordering
of the layers in admix.mat2
that maximizes
similarity between admix.mat1
and re-ordered
admix.mat2
.
Examples
# compare the estimated admixture proportions from
# two different conStruct runs to determine which
# layers in one run correspond to those in the other
match.layers.x.runs(admix.props1,admix.props2)