residuals.corregp: Extracting Residuals from Correspondence Regression

Description Usage Arguments Details Value See Also Examples

Description

Method to extract the residuals of a correspondence regression.

Usage

1
2
3
4
5
## S3 method for class 'corregp'
residuals(object, parm = "all", nf = NULL, ...)

## S3 method for class 'corregp'
resid(object, parm = "all", nf = NULL, ...)

Arguments

object

The output of a call to corregp (i.e. an object of class "corregp").

parm

The parameter for which to extract the residuals. Can be "all", "both" (or abbreviations), "y" or "x" for the residuals of every cell in the data, but it can also be any vector of term names in X or level names in X. Defaults to "all".

nf

The number of dimensions to be retained in the reduced space. Defaults to all dimensions (no reduction).

...

Further arguments passed to or from other methods.

Details

If all dimensions are retained, then the residuals will only be exactly zero to the observed counts if no conditioning factors were specified with the argument "part" in the corregp call. This is because the associations with the conditioning factors (in "part") are not taken into account.

Value

A matrix or vector with the residuals for the parameters of interest, based on the selected number of dimensions.

See Also

coef.corregp, fitted.corregp.

Examples

1
2
3
4
data(HairEye)
haireye.crg <- corregp(Eye ~ Hair * Sex, data = HairEye, b = 3000)
residuals(haireye.crg, parm = c("Hair", "Sex"), nf = 2)
resid(haireye.crg, parm = c("Hair", "Sex"), nf = 2)

corregp documentation built on May 1, 2019, 10:08 p.m.