addGroups2WFUN: Group-Dependent Parametric Weights

addGroups2WFUNR Documentation

Group-Dependent Parametric Weights

Description

This function takes a specification of parametric weights and returns a modified version with group-dependent parameters. Only single-parameter functions are currently supported.

Usage

addGroups2WFUN(WFUN, groups, initial = rep.int(WFUN$initial, nlevels(groups)))

Arguments

WFUN

a list specification of parametric weights, e.g., as returned by the constructor functions W_powerlaw and W_np.

groups

a vector of length nUnits determining to which group each unit belongs to. The supplied vector is converted to a factor using as.factor.

initial

(named) vector of initial parameters.

Value

a list specifying group-dependent parametric weights for hhh4.

Author(s)

Sebastian Meyer

Examples

data("measlesWeserEms")
WPLgroups <- addGroups2WFUN(
  W_powerlaw(maxlag = 5, normalize = FALSE, log = FALSE),
  groups = factor(sample(2, ncol(measlesWeserEms), replace = TRUE)))

hhh4contacts documentation built on Oct. 8, 2024, 1:08 a.m.