inter_xij.Rd
Interact several factors. This function allows for binary \(\{0,1\}\) interaction between observable factors xi and xj. xi and xj should be of the same length. It creates a 1 if i and j belong to the same category (xi=xj) and zero otherwise. This function also allows several factors i.e. xi and xj as vectors
inter_xij(xi, xj, k = length(xi))
xi | vector of first variable terms |
---|---|
xj | vector of second variable terms |
k | a dummy input as length of xi; does not need to be specified. |
vector of binaries \(\{0,1\}\) the same length as xi
#> [1] 1 1 0