predict.bgPCA {Morpho}R Documentation

Compute between-group-PC scores from new data

Description

Compute between-group-PC scores from new data

Usage

## S3 method for class 'bgPCA'
predict(object, newdata, ...)

Arguments

object

object of class bgPCA returned from groupPCA

newdata

matrix or 3D array containing data in the same format as originally used to compute groupPCA

...

currently not used.

Value

returns the between-group-PC scores for new data

Examples

data(boneData)

boneLMPart <- boneLM[,,-(1:2)]
procPart <- procSym(boneLMPart)
pop_sex <- name2factor(boneLMPart, which=3:4)
## compute group PCA without first 2 specimens
gpcaPart <- groupPCA(procPart$orpdata, groups=pop_sex, rounds=0, mc.cores=2,cv=FALSE)
## align new data to Procrustes analysis
newdata <- align2procSym(procPart,boneLM[,,1:2])
## get scores for new data
newscores <- predict(gpcaPart,newdata)

[Package Morpho version 2.12 Index]