codgroup: Semi-automatized grouping of causes of deaths

Description Usage Arguments Details Value See Also Examples


Using the age- and cause-specific mortality rates, this function applies hierarchical clustering to suggest possible cause-of-death groupings that isolate the causes that are suceptible to contribute to the young adult mortality hump.


codgroup(data, x.range = 10:35, k = "ASW")



list produced with HCD2MH or similarly structured


age range to consider for the analysis


either a fixed number of cluster or the name of the criterion to use for selection


This function is designed to help selecting the causes of death that contribute to the young adult mortality hump. It procedes in steps.

  1. Compute the first derivative of the force of mortality (rxc) for each cause, in order to focuse on the amount of deviation instead of the absolute death rate.

  2. Using the provided age-range, compute the euclidian distance between each couple of causes.

  3. Based on this distance, run a hierchical clustering method ("complete" algorithm of the hclust function).

  4. If k is numerical, it is taken as the chosen number of clusters and each cause of death is assigned to one of the k groups. Alternatively, k can indicate one of the selection criteria available in the WeightedCluster package. Among the most interesting options, is the Average Silhouette Width (ASW) that compares the average distance of an observation from the other members of its group and its average distance from the closest group. The ASW is computed for each number of groups k, and the one maximising the ASW is selected for its ability to maximise the homogeneity within the groups and the heterogeneity between the groups.


codgroup returns a list of six elements containing


An object of class hclust on which additional analysis can be performed.


A membership vector indicating a group number for each of the causes of death.


The number of groups chosen.


A list of groups of causes as needed by the function codhump.


The original data stored in a list produced with HCD2MH or similarly structured


A vector indicating the age range to consider for the analysis

See Also

codhump, HCD2MH, as.clustrange



grouping <- codgroup(USA2000m, k = "ASW", x.range = 10:35)

MortHump documentation built on April 14, 2017, 2:22 p.m.

Search within the MortHump package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.