make_restrictions
, then that function would need to
have some of the same arguments as this one.
mapping_rule(coefs, cormat, zeros = rep(ncol(coefs), ncol(coefs)),
row_complexity = NA_integer_, quasi_Yates = FALSE, weak_Thurstone = FALSE,
Butler = FALSE, viral = FALSE, mve = FALSE, communality = FALSE)
coefs
, which
indicates the requisite number of non-zero coefficients
in that row of the primary pattern matrix. If a scalar, this
complexity is used for all rows of the primary pattern matrix.
If NA_integer_
(the default) this row-wise mapping rule
is not enforced FALSE
because this
mapping rule is (perhaps permanently) disabled By default, this function is copied into the mapping_rule
slot in the call to make_restrictions
and its
formals
are adjusted to correspond to the specified
mapping rule. You may wish to do so manually in rare circumstances.
If a different function is used to enforce a mapping rule, it
should also have coefs
, cormat
, and zeros
arguments as documented above.
The vignette has more details on Reiersøl's (1950)
theorem and defines these mapping rules in symbols. To describe
them briefly, the default mapping rule simply loops through the
zeros
argument and squashes the smallest zeros[p]
cells (by magnitude) in the $p$th column of coefs
to
zero and returns the resulting matrix. This is the behavior
depicted in the first example and can be brought about by leaving
all the arguments that have default values at their defaults.
Only one mapping rule should be requested. The execption is that
the default mapping rule is often called after a non-default
mapping rule has been applied to make sure that that the $p$th
column has zeros[p]
zeros in it.
The weak_Thurstone
mapping rule is similar but has an
additional provision that no row of coefs
may contain
more than one (exact) zero. This mapping rule can
be seen as minimally satisfying Thurstone's (1947) second and
third rules for identification.
The row_complexity
mapping rule is simply applied to
the rows of the primary pattern matrix rather than the columns.
Note that the complexity of an outcome is its number of
non-zero coefficients. This mapping rule could loop over
row_complexity
(it actually utilizes apply
)
and squashes all but the largest (by magnitude)
row_complexity[j]
coefficients in the $j$th row of the
reference structure matrix to zero and then rescales the result
back to the primary pattern matrix. Then the default mapping rule
is called, which may do nothing if there are now enough zeros in
each column of coefs
and the result is returned.
The Butler
mapping rule concentrates the zeros within rows
so that each factor correspons to an outcome of complexity one.
Then, the default mapping rule is called to obtain more zeros
for the $p$th factor.
The viral
mapping rule is less drastic but concentrates
two zeros into each of $2 * factors$ rows of coefs
and is possibly useful if the number of factors is large. Then,
the default mapping rule is called to obtain more zeros for the
the $p$th factor.
The other mapping rules are more advanced and rely on the factor
contribution matrix which is the element-by-element product of
the the pattern and structure matrices. The
rowSums
of the factor contribution matrix is
a vector of communalities. The communality
mapping rule places
one zero per factor in a row of coefs
corresponding to
a row of the factor contribution matrix with a high ratio of
its arithmetic mean to its geometric mean. Then, the default
mapping rule is called to obtain a sufficient number of zeros
for the $p$th factor.
The quasi_Yates
mapping rule places zeros in rows of
coefs
corresponding to rows of the factor contribution
matrix with large differences between columns. The idea is to
place zeros in rows where one factor is weak and another factor
is strong in terms of explaining the variance in the corresponding
outcome variable. This mapping rule is intended to achieve
cohyperplanarity as discussed in Yates (1987), albeit
not in reference to SEFA.
make_restrictions
, parameter.coef.SEFA-class
## This is just a demo; you should NOT call this function directly
cormat <- diag(2) # factor intercorrelation matrix
coefs <- matrix(rnorm(20), nrow = 10, ncol = 2) # primary pattern matrix
zeros <- c(2, 2) # we require two zeros per factor
any(coefs == 0) # FALSE
## Default mapping rule
coefs_default <- mapping_rule(coefs, cormat, zeros)
colSums(coefs_default == 0) # c(2, 2)
# Now the 2 smallest coefficients in each column are squashed to zero
print(cbind(coefs, NA, coefs_default), digits = 3)
## row_complexity mapping rule
coefs_row <- mapping_rule(coefs, cormat, zeros, row_complexity = 1)
colSums(coefs_default == 0) # at least two per factor
# Now the smaller coefficient in each row is squashed to zero
print(cbind(coefs, NA, coefs_row), digits = 3)
## The other mapping rules are sort of useless in the two factor case
Run the code above in your browser using DataLab