morpho_indices: Simpson's Log-Size Index (LSI) and Uerpmann's Variability...

View source: R/Morpho_Indexes_with_bootstrap.R

morpho_indicesR Documentation

Simpson's Log-Size Index (LSI) and Uerpmann's Variability Size Index, with bootstrap

Description

The function computes Simpson's Log-Size Index (LSI) and Uerpmann's Variability Size Index (and bootstrap).

Usage

morpho_indices(
  dat = data.list,
  ref = 1,
  k = 25,
  data.type = "summary",
  which.ind = NULL,
  which.desc = 1:dim(dat[[1]])[2],
  N.sample = length(dat),
  bootstrap = "off",
  iter = 1000,
  VCV = F,
  center.mISD = F,
  plots = F,
  col = c("black", rainbow(N.sample - 1))
)

Arguments

dat

Input data should be a list of matrices/data frames

ref

Index of the reference sample, default is 1, so the first sample in 'dat' is taken to be the reference.

k

Value for k (arbitrary constant for VSI calculation).

data.type

Type of the data. Can be 'individuals', if all samples in 'dat' contain detailed measurements by individual. Can be 'summary' (default), if all samples in 'dat' have N, Mean, and St-Dev (summary statistics) as lines. Can be 'both' if both types of data are mixed, in that case, argument 'which.ind' must be specified. When data.type="both", all samples ith individuals are converted to summary statistics before computing anyhting.

which.ind

Numeric vector containing index of samples which have individual measurements (including reference if needed).

which.desc

Which morphological descriptors (traits) are to be used. By default all are used. Note: Descriptors can also be filtered when plotting with the 'plot.mo.ind' function.

N.sample

Number of samples (including reference).

bootstrap

Type of bootstrap to be used. Default is 'off' = no bootstrap. Can be 'p' = parametric bootstrap. Can be 'np' = non-parametric bootstrap, only possible when using 'individuals' as data type. If data.type="both", only the parametric bootstrap is used (samples are converted to summary statistics). To combine 'np' and 'p' bootstrap when using mixed data, run the function separately for individual samples and summary samples (both with the SAME reference sample, which should be individuals). Outputs can then be combined using the 'combin.mo.ind' function.

iter

Number of iterations for the resampling (default = 1000).

VCV

Maintain variance-covariance structure when resampling or not (default = F). VCV = T only available for bootstrap="np" so far. This means that individuals can be resampled 'as a whole' or resampled fo each descriptor. Differences in confidence intervals should be minor between both.

center.mISD

Should the data be centered with mISD (isometric size)? Default=F.

plots

Should basic plots be plotted (default = F). More flexible plotting can be done with 'plot.mo.ind' function.

col

Vector of colors for the plot (length=number of samples).

Details

The function computes Simpson's Log-Size Index (LSI) and Uerpmann's Variability Size Index. Works with several samples, one of which is the reference. Samples are constituted by: Several measurements for several individuals, or summary statistics for each descriptor (N, mean, sd). The function can be used with: List of matrices (samples x individuals x measurements), or list of matrices (samples x summary stats x measurements), or mixed list of matrices (some with individual measurements, other with summary stats). In the latter case, matrices with individual measurements will be converted to matrices with summary stats. The function includes parametric and non-parametric bootstraps, this allows to test differences between samples. Tests can be global first then check which measurement matters.

Value

LSI.df Dataframe of values of Simpson's Log-Size Index (Simpson 1941).

VSI.df Dataframe of values of Uerpmann's Variability Size Index (Upermann 1982).

VSI2.df Dataframe of values of modified Uerpmann's Variability Size Index (Escarguel 2008).

LSI.bootstrap List of matrices of bootstrapped values of LSI. Each matrix represents boostraps for one sample.

VSI.bootstrap Same as previous for VSI.

VSI2.bootstrap Same as previous for VSI2.

LSI.mISD Vector of values of mean isometric size difference (mISD) for LSI.

VSI.mISD Same as previous for VSI.

VSI2.mISD Same as previous for VSI2

LSI.CI List of matrices of 95

VSI.CI Same as previous for VSI.

VSI2.CI Same as previous for VSI2.

LSI.meanboot Matrix of LSI bootstrapped average values.

VSI.meanboot Same as previous for VSI.

VSI2.meanboot Same as previous for VSI2.

LSI.medianboot Matrix of LSI bootstrapped median values.

VSI.medianboot Same as previous for VSI.

VSI2.medianboot Same as previous for VSI2.

LSI.sdboot Matrix of LSI standard deviation values.

VSI.sdboot Same as previous for VSI.

VSI2.sdboot Same as previous for VSI2.

Examples

data("equus", package="MorphoInd")
o <- morpho_indices(dat=equus, ref=1, data.type="summary", bootstrap="p", plot=F) #This will compute LSI, VSI and VSI2 value, parametric bootstrap values, CIs and mISD.
plot_mo_ind(dat=o, name=names(equus), ref=1, samp=c(2:5), index="VSI", CI=T, plot.mISD=F) #Example of plot with selected samples (2:5) and CIs.

sginot/MorphoInd documentation built on Jan. 27, 2024, 1:32 a.m.