Learn R Programming

conStruct (version 1.0.6)

calculate.layer.contribution: Calculate layer contribution

Description

calculate.layer.contribution

Usage

calculate.layer.contribution(conStruct.results, data.block, layer.order = NULL)

Value

This function returns a vector giving the relative contributions of the layers in the analysis.

Arguments

conStruct.results

The list output by a conStruct run for a given MCMC chain.

data.block

A data.block list saved during a conStruct run.

layer.order

An optional vector giving the order in which the layers of conStruct.results are read.

Details

This function takes the results of a conStruct analysis and calculates the relative contributions of each layer to total covariance.

This function calculates the contribution of each layer to total covariance by multiplying the within-layer covariance in a given layer by the admixture proportions samples draw from that layer. The relative contribution of that layer is this absolute contribution divided by the sum of those of all other layers. A layer can have a large contribution if many samples draw large amounts of admixture from it, or if it has a very large within-layer covariance parameter (phi), or some combination of the two. Layer contribution can be useful for evaluating an appropriate level of model complexity for the data (e.g., choosing a value of K or comparing the spatial and nonspatial models).