logique {multiv}R Documentation

Logical Coding

Description

Simple logical coding of a vector: each value in the vector is replaced by a 1 (if it is above or equal to the median), by a 0 (if it is below the median).

Usage

logique(a)

Arguments

a real-valued vector, with no missing values.

Value

matrix of length(a) rows, and two columns. The first column contains the logically coded values of a, and the second column contains their complements. Hence each row of this returned matrix necessarily sums to 1.

BACKGROUND

This form of coding is suitable for a subsequent correspondence analysis. When all variable have been logically (or fuzzily) coded, the row masses (proportional to the row sums) are identical. Logical coding results in the input being in complete disjunctive form.

References

J.-P. Benzecri Correspondence Analysis Handbook Marcel Dekker, Basel, 1992.

See Also

flou, ca, supplr, supplc.

Examples

# Logical coding of input variables, `a', `b', `c':
a.log <- logique(a)
b.log <- logique(b)
c.log <- logique(c)
newdata <- cbind(a.log, b.log, c.log)
ca.newdata <- ca(newdata)

[Package Contents]