Skip to contents

This function provides a high-dimensional analysis of variance (HDANOVA) method which can be used alone or as part of a larger analysis, e.g., ASCA, APCA, LiMM-PCA, MSCA or PC-ANOVA. It can be called directly or through the convenince functions asca, apca, limmpca, msca and pcanova.

Usage

hdanova(
  formula,
  data,
  subset,
  weights,
  na.action,
  family,
  unrestricted = FALSE,
  add_error = FALSE,
  aug_error = "denominator",
  use_ED = FALSE,
  pca.in = FALSE,
  contrasts = "contr.sum",
  coding,
  equal_baseline = FALSE,
  SStype = "II",
  REML = NULL
)

Arguments

formula

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

data

The data set to analyse.

subset

Expression for subsetting the data before modelling.

weights

Optional object weights.

na.action

How to handle NAs (no action implemented).

family

Error distributions and link function for Generalized Linear Models.

unrestricted

Use unrestricted ANOVA decomposition (default = FALSE).

add_error

Add error to LS means, e.g., for APCA.

aug_error

Augment score matrices in backprojection. Default = "denominator" (of F test), "residual" (force error term), nueric value (alpha-value in LiMM-PCA).

use_ED

Use "effective dimensions" for score rescaling in LiMM-PCA.

pca.in

Compress response before ASCA (number of components).

contrasts

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

coding

Defunct. Use 'contrasts' instead.

equal_baseline

Experimental: Set to TRUE to let interactions, where a main effect is missing, e.g., a nested model, be handled with the same baseline as a cross effect model. If TRUE the corresponding interactions will be put in quotation marks and included in the model.frame.

SStype

Type of sum-of-squares: "I" = sequential, "II" (default) = last term, obeying marginality, "III" = last term, not obeying marginality.

REML

Parameter to mixlm: NULL (default) = sum-of-squares, TRUE = REML, FALSE = ML.

Value

An hdanova object containing loadings, scores, explained variances, etc. The object has associated plotting (asca_plots) and result (asca_results) functions.

Examples

# Load candies data
data(candies)

# Basic HDANOVA model with two factors
mod <- hdanova(assessment ~ candy + assessor, data=candies)
summary(mod)
#> High-Dimensional Analysis of Variance fitted using 'lm' (Linear Model) 
#> - SS type II,  coding, restricted model, least squares estimation 
#>            Sum.Sq. Expl.var.(%)
#> candy     33416.66        74.48
#> assessor   1961.37         4.37
#> Residuals  9489.25        21.15