Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

compfactor

Find the connected components


Description

'compfactor' computes the connected components of the dummy-part of the model.

Usage

compfactor(fl, WW = FALSE)

Arguments

fl

a list of factors defining the dummies

WW

logical. Use Weeks and Williams components

Details

If there are more than two factors and WW=FALSE, only the first two will be used.

If WW=TRUE and length(fl) > 2, the component structure will be as in "A Note on the Determination of Connectedness in an N-Way Cross Classification" by D.L. Weeks and D.R. Williams, Technometrics, vol 6 no 3, August 1964. I.e. in each component, the coefficients within each factor are comparable, that is, their difference is estimable even if there are more than two factors. That is, one may use one reference in each factor in each component, and interpret the coefficients within a component as usual. This is not an exhaustion of all the estimable functions. There is somewhat more about this in one of the vignettes.

Value

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

Examples

## 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,]

lfe

Linear Group Fixed Effects

v2.8-6
Artistic-2.0
Authors
Simen Gaure [aut] (<https://orcid.org/0000-0001-7251-8747>), Grant McDermott [ctb], Karl Dunkle Werner [ctb], Matthieu Stigler [ctb, cre] (<https://orcid.org/0000-0002-6802-4290>), Daniel Lüdecke [ctb]
Initial release
2021-01-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.