ILDSR2: Compute R2 for Interlandmark Distances

View source: R/ILDS.r

ILDSR2R Documentation

Compute R2 for Interlandmark Distances

Description

Compute R2 for Interlandmark Distances explaining between group differences

Usage

ILDSR2(
  x,
  groups,
  R2tol = 0.9,
  autocluster = TRUE,
  gap = TRUE,
  bg.rounds = 999,
  wg.rounds = 999,
  which = 1:2,
  reference = NULL,
  target = NULL,
  mc.cores = 1,
  plot = FALSE,
  silent = FALSE,
  ...
)

Arguments

x

array containing landmarks

groups

vector containing group assignments or a numeric covariate. For groups with more than two levels, a pair of needs to be specified using which

R2tol

numeric: upper percentile for ILD R2 in relation to factor or in case autocluster=TRUE, the minimum quantile allowed.

autocluster

logical: if TRUE, the function is trying to find a cluster with the highest R2-values. In this case R2tol is used as the quantile the cluster is allowed to occupy.

gap

logical: if TRUE, the largest gap in the R2 distribution is sought. If FALSE, a clustering procedure is used.

bg.rounds

numeric: number of permutation rounds to assess between group differences

wg.rounds

numeric: number of rounds to assess noise within groups by bootstrapping.

which

integer (optional): in case the factor levels are > 2 this determins which factorlevels to use

reference

matrix containing start config landmarks. If NULL, it will be computed as mean for group 1.

target

matrix containing target config landmarks. If NULL, it will be computed as mean for group 2.

mc.cores

integer: number of cores to use for permutation tests.

plot

logical: if TRUE show graphical output of steps involved

silent

logical: suppress console output

...

additional parameters for internal use only.

Value

A list containing:

relevantILDs

containing landmark information with the highest R2-values

allR2

vector with ILD specific R2-values, sorted decreasingly

reftarILDS

matrix with columns containing ILDs for reference and target shapes

sampleILD

matrix containing ILDs of entire sample

R2tol

R2-threshold used

reference

reference used

target

target used

bg.test

result from between-group testing

confR2

confidence for relevant ILDs from bootstrapping

x

Procrustes superimposed raw data (without scaling)

Examples

require(Morpho)
data(boneData)
proc <- procSym(boneLM)
groups <- name2factor(boneLM,which=3)
ilds <- ILDSR2(proc$rotated,groups,plot=TRUE,wg.rounds=99,mc.cores=1)
if (interactive())
visualize(ilds)
## use covariate
## Not run: 
ildsLM <- ILDSR2(proc$rotated,groups=proc$size,plot=TRUE,wg.rounds=99,mc.cores=1)
if (interactive())
visualize(ildsLM)

## End(Not run)

## 2D Case with size as predictor
require(shapes)
require(Morpho)
gor.dat <- bindArr(gorf.dat,gorm.dat,along=3)
procg <- procSym(gor.dat)
ildsg <- ILDSR2(procg$rotated,procg$size,plot=FALSE,bg.rounds=999,wg.rounds=99,
                mc.cores=1,autocluster=TRUE,R2tol=.8)

Morpho documentation built on Sept. 9, 2025, 5:46 p.m.