Learn R Programming

corregp (version 2.0.2)

fitted.corregp: Extracting Fitted Values from Correspondence Regression

Description

Method to extract the fitted values of a correspondence regression.

Usage

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

# S3 method for corregp fitted.values(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 fitted values. Can be "all", "both" (or abbreviations), "y" or "x" for the fitted values 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.

Value

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

Details

If all dimensions are retained, then the fitted values will only be equal 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.

See Also

coef.corregp, residuals.corregp.

Examples

Run this code
# NOT RUN {
data(HairEye)
haireye.crg <- corregp(Eye ~ Hair * Sex, data = HairEye, b = 3000)
fitted(haireye.crg, parm = c("Hair", "Sex"), nf = 2)
fitted.values(haireye.crg, parm = c("Hair", "Sex"), nf = 2)
# }

Run the code above in your browser using DataLab