con_check {connected} | R Documentation |
Check connectedness of multiple factors in a dataframe
Description
Multiple factors in a dataframe are said to be connected if a model matrix based on those factors is full rank.
This function provides a formula interface to the lfe::compfactor() function to check for connectedness of the factors.
Usage
con_check(data = NULL, formula = NULL, WW = TRUE, dropNA = TRUE)
Arguments
data |
A dataframe |
formula |
A formula with multiple factor names in the dataframe,
like |
WW |
Pass-through argument to |
dropNA |
If TRUE, observed data that are |
Value
A vector with integers representing the group membership of each observation.
Author(s)
Kevin Wright
References
None
Examples
# In the data_eccleston dataframe, each pair of factors is connected.
con_check(data_eccleston, ~ row + trt)
con_check(data_eccleston, ~ col + trt)
con_check(data_eccleston, ~ row + col)
# But all three factors are COMPLETELY disconnected into 16 groups.
con_check(data_eccleston, ~ row + col + trt)
[Package connected version 1.1 Index]