Skip to contents

This function mimics parts of the LiMM-PCA framework, combining ASCA+ and linear mixed models to analyse high-dimensional designed data. The default is to use REML estimation and scaling of the backprojected errors. See examples for alternatives.

Usage

limmpca(
  formula,
  data,
  pca.in = 5,
  aug_error = 0.05,
  use_ED = FALSE,
  REML = TRUE,
  contrasts = "contr.sum",
  permute = FALSE,
  perm.type = c("approximate", "exact"),
  ...
)

Arguments

formula

Model formula accepting a single response (block) and predictors. See Details for more information.

data

The data set to analyse.

pca.in

Compress response before ASCA (number of components), default = 5.

aug_error

Error term of model ("denominator", "residual", numeric alpha-value). The latter implies the first with a scaling factor.

use_ED

Use Effective Dimensions instead of degrees of freedom when scaling.

REML

Use restricted maximum likelihood estimation. Alternatives: TRUE (default), FALSE (ML), NULL (least squares).

contrasts

Effect coding: "sum" (default = sum-coding), "weighted", "reference", "treatment".

permute

Number of permutations to perform (default = 1000).

perm.type

Type of permutation to perform, either "approximate" or "exact" (default = "approximate").

...

Additional arguments to hdanova.

Value

An object of class limmpca, inheriting from the general asca class.

References

  • Martin, M. and Govaerts, B. (2020). LiMM-PCA: Combining ASCA+ and linear mixed models to analyse high-dimensional designed data. Journal of Chemometrics, 34(6), e3232.

See also

Main methods: asca, apca, limmpca, msca, pcanova, prc and permanova. Workhorse function underpinning most methods: hdanova. Extraction of results and plotting: asca_results, asca_plots, pcanova_results and pcanova_plots

Examples

# Load candies data
data(candies)

# Default LiMM-PCA model with two factors and interaction, 5 PCA components
mod <- limmpca(assessment ~ candy*r(assessor), data=candies)
#> boundary (singular) fit: see help('isSingular')
summary(mod)
#> LiMM-PCA fitted using 'lmm' (Linear Mixed Model) 
#> - SS type II,  coding, restricted model, REML estimation 
#>                 Sum.Sq. Expl.var.(%)
#> candy          33394.40        78.00
#> assessor:candy   621.64         1.45
#> assessor         793.50         1.85
#> Residuals       6162.61        14.39
scoreplot(mod, factor = "candy")


# LiMM-PCA with least squares estimation and 8 PCA components
modLS <- limmpca(assessment ~ candy*r(assessor), data=candies, REML=NULL, pca.in=8)
summary(modLS)
#> LiMM-PCA fitted using 'lmm' (Linear Mixed Model) 
#> - SS type II,  coding, restricted model, least squares estimation 
#>                 Sum.Sq. Expl.var.(%)
#> candy          33415.98        74.73
#> assessor        1948.75         4.36
#> assessor:candy  3419.04         7.65
#> Residuals       5934.46        13.27
scoreplot(modLS, factor = "candy")


# Load Caldana data
data(caldana)

# Combining effects in LiMM-PCA (assuming light is a random factor)
mod.comb <- limmpca(compounds ~ time + comb(r(light) + r(time:light)), data=caldana, pca.in=8)
#> boundary (singular) fit: see help('isSingular')
#> boundary (singular) fit: see help('isSingular')
#> boundary (singular) fit: see help('isSingular')
#> boundary (singular) fit: see help('isSingular')
summary(mod.comb)
#> LiMM-PCA fitted using 'lmm' (Linear Mixed Model) 
#> - SS type II,  coding, restricted model, REML estimation 
#>                  Sum.Sq. Expl.var.(%)
#> time              129.51        11.20
#> light+light:time   83.89         7.25
#> Residuals         833.20        72.05