Description Usage Arguments Details Value
Construct a data frame that represents a sparse matrix with nonzero
constraint coefficients. A constraint coefficient is the amount by which a
constraint changes if an element of the vector x
changes by one unit. This
stores only those coefficients that are nonzero, in triplet form, where i
is an index identifying which constraint is represented, j
is an index
identifying which element of the vector x
is represented, and nzcc
is the
value of the nonzero constraint coefficient.
1 | get_cc_sparse(xmat, target_names, iweights)
|
xmat |
Numeric matrix of unweighted data values in dense form where each row is a household, each column corresponds to a constraint, and each cell is a data value. |
target_names |
Character vector with names for each constraint. One element per
column in |
iweights |
Numeric vector of initial weights in the microdata file, one per row in |
The data value in xmat
multiplied by the initial weight determines how much
a constraint will change with a unit change in x
, the ratio of the new
weight to the initial weight. For example, suppose household number 7 has
income of $10,000 then. Suppose that this household is in row 7 of xmat
and
that column 3 of xmat
corresponds to income. If this household has an
initial weight of 20, then the constraint coefficient for this cell - how
much changing the x
value for this household will change the constraint for
total income - is 200,000 (20 x 100,000). The constraints coefficient data
frame will have a row where i
(the index for the constraint, not the household)
is 3, j
(the index for the household) is 7, and nzcc
is 200000.
A data frame representing a sparse matrix of constraint coefficients, with columns:
the constraint number
an index into x
constraint name, from target_names
the nonzero constraint coefficient - the initial weight multiplied by value
initial weight for this cell
data value
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.