preSumSq: Prepare sum-of-squares computations

Description Usage Arguments Value

View source: R/anova.R

Description

preSumSq prepares the objects which are needed by compSumSq. Thus, it returns the model.matrix (X), the X'X matrix, and all unique rows of Xs, and also the residuals if residuals are permuted instead of raw observations.

Usage

1
2
3
4
5
6
7
8
9
preSumSq(
  form,
  form_data,
  keep_term_order = FALSE,
  scaled = FALSE,
  y = NULL,
  between = NULL,
  adjusted = TRUE
)

Arguments

form

model formula (or character string to as.formula)

form_data

a data.frame containing all variables of the formula

keep_term_order

a logical value indicating whether the terms should keep their positions. If FALSE the terms are reordered so that main effects come first, followed by the interactions, all second-order, all third-order and so on. Effects of a given order are kept in the order specified.

scaled

a logical value indicating if numeric variables in 'form_data' are already scaled (TRUE) or not (FALSE, the default).

y

a numeric matrix of response data if residuals should be computed (usually coming from preAnova)

between

the names of between-subject factors. Only used for warning message in case of unbalanced data.

adjusted

adjustment for unbalanced data (default: TRUE)

Value

A list with the following components: model_matrix, model_matrix_labels, xpx, unique_contrasts, residuals (optional).


tdeenes/eegR documentation built on April 19, 2021, 4:17 p.m.