xy_Obj: Creation of a design-with-responses object

View source: R/xy_Obj.R

xy_ObjR Documentation

Creation of a design-with-responses object

Description

The function takes an object created by x_Obj as input and add response values. Further initial computations for prediction and testing is made.

Usage

xy_Obj(xObj, Y)

ffModelObj(
  xObj,
  Y,
  modelMatrix,
  modelTerms,
  model,
  xlev,
  scaleY,
  scaleX,
  centerX,
  isIntercept,
  returnY = FALSE,
  returnYhat = FALSE,
  returnYhatStd = FALSE
)

Arguments

xObj

object created by x_Obj

Y

response matrix

modelMatrix

Model matrix (output from model.matrix) to be included in output.

modelTerms

Model terms (model frame attribute) to be included in output.

scaleY

Values used to scale Y (see stdize) to be included in output.

scaleX

Values used to scale the model matrix (see stdize) to be included in output.

centerX

Values used to center the model matrix (see stdize) to be included in output.

isIntercept

A logical (whether model has intercept) to be included in output.

returnY

Matrix Y (as input) in output when TRUE.

returnYhat

Matrix Yhat of fitted values corresponding to Y in output when TRUE.

returnYhatStd

Standard errors, YhatStd, in output when TRUE.

Details

Traditionally, sums of squares and cross-products (SSC) is the multivariate generalisation of sums of squares. When there is a large number of responses this representation is inefficient and therefore linear combinations of observations (Langsrud, 2002) is stored instead, such as errorObs. The corresponding SSC matrix can be obtained by t(errorObs)%*%errorObs. When there is a large number of observations the errorObs representation is also inefficient, but it these cases it is possible to chose a representation with several zero rows. Then, errorObs is stored as a two-component list: A matrix containing the nonzero rows of errorObs and an integer representing the degrees of freedom for error (number of rows in the full errorObs matrix).

Value

A list with components

xObj

same as input

Y

same as input

ssTotFull

equals sum(Y^2)

ssTot

equals sum((center(Y))^2). That is, the total sum of squares summed over all responses.

ss

Sums of squares summed over all responses.

Beta

Output from linregEst where xObj$D_om is the regressor matrix.

Yhat

fitted values

YhatStd

standard deviations of fitted values

msError

mean square error of each response

errorObs

Error observations that can be used in multivariate testing

hypObs

Hypothesis observations that can be used in multivariate testing

Note

ffModelObj is a rewrite of xy_Obj with additional elements in output corresponding to the additional parameters in input. Furthermore, Y and YhatStd is by default not included in output.

Author(s)

Øyvind Langsrud and Bjørn-Helge Mevik

References

Langsrud, Ø. (2002) 50-50 Multivariate Analysis of Variance for Collinear Responses. The Statistician, 51, 305–317.


ffmanova documentation built on Oct. 18, 2023, 5:08 p.m.

Related to xy_Obj in ffmanova...