Weight links by their importance rather than counting them
Source:R/share-weights.R
weighted_links.RdA declarative marker for share_weights()'s multiplicity argument. It
replaces the 0/1 link indicator with a non-negative quantity saying how much
of a target unit each link accounts for: a subsidiary's share of an
enterprise's assets, a child's share of time with each parent.
Arguments
- x
A single non-negative column of
linksholding the importance of each link.- total
The population total of that importance for each target unit: a column of
targets, orcomplete_links()to assert thatlinksis the complete population register and let samplyr total the importances. That is the same assertionmultiplicity = complete_links()makes about counts, so it is the same marker.
Value
weighted_links() is only meaningful inside
share_weights(multiplicity = ) and otherwise throws an error.
Details
Lavallee section 4.5 generalizes the method to any such quantity with no loss of theory, subject to Constraint 4.1: the total over each target cluster must be strictly positive.
The argument is not called theta. Lavallee uses that name for normalized
link constants and survey::multiframe() uses it for an unrelated
frame-compositing factor, and a workflow can involve both.
See also
Other weight sharing:
complete_links(),
extend_links(),
share_weights()
Examples
# Used inside share_weights():
# share_weights(sample, targets, links, by, to, within = enterprise,
# multiplicity = weighted_links(asset_share,
# total = population_assets))
# or, asserting that `links` is the complete register:
# share_weights(sample, targets, links, by, to, within = enterprise,
# multiplicity = weighted_links(asset_share,
# total = complete_links()))