Learn R Programming

lfe (version 1.4-641)

compfactor: Finding the connection components

Description

'compfactor' computes the connection components of the dummy-part of the model with multiple fixed effects.

Usage

compfactor(fl)

Arguments

Value

A factor of the same length as the factors in the input argument. It defines the connection components. E.g. nlevels(compfactor(fl)) will yield the number of connection components.

Details

If there are more than two factors, only the first two will be used.

Examples

Run this code
## create two factors
f1 <- factor(sample(300,400,replace=TRUE))
f2 <- factor(sample(300,400,replace=TRUE))

## find the components
cf <- compfactor(list(f1=f1,f2=f2))

## show the third largest component
fr <- data.frame(f1,f2,cf)
fr[cf==3,]

Run the code above in your browser using DataLab