dg2pop {DasGuptR} | R Documentation |
Standardisation and decomposition of rates over K rate-factors and 2 populations. We suggest using dgnpop, which will internally call this function.
Description
Standardisation and decomposition of rates over K rate-factors and 2 populations. We suggest using dgnpop, which will internally call this function.
Usage
dg2pop(pw, pop, factors, id_vars, ratefunction = NULL, quietly = TRUE)
Arguments
pw |
dataframe containing two populations worth of factor data, with columns specifying 1) population and 2) each rate-factor to be considered. must have column named "pop" indicating the population ID. |
pop |
name (character string) of variable indicating population |
factors |
names (character vector) of variables indicating compositional factors |
id_vars |
character vector of variables indicating sub-populations |
ratefunction |
user defined character string in R syntax that when evaluated specifies the function defining the rate as a function of factors. if NULL then will assume rate is the product of all factors. |
quietly |
logical indicating whether interim messages should be outputted indicating progress through the P factors |
Value
named list along set of K factors included in the standardisation. Each list element contains a data.frame that includes K-a standardised rates for each population, along with differences between standardised rates