timing_trajectory: Timing pattern frequency within clusters

View source: R/summary.R

timing_trajectoryR Documentation

Timing pattern frequency within clusters

Description

timing_trajectory() calculates the average timing paths within clusters.

Usage

timing_trajectory(
  object,
  only = NULL,
  clusters = NULL,
  additional_data = NULL,
  ...
)

Arguments

object

An object for which a summary is desired.

only

<data-masking> Expressions that return a logical value, and are defined in terms of the variables in object and/or additional_data.

The default NULL selects all clusterings in object.

clusters

<tidy-select> An unquoted expression naming the cluster or clusters in object one wants to see summaries of. Names can be used as if they were positions in the data frame, so expressions like I:IV can be used to select a range of clusters.

The default NULL selects all clusters in the chosen clusterings of object.

additional_data

A data frame with additional data that may be (left-)joined onto the parameters in object. This is often used in conjuction with only to select specific clusterings based on additional_data.

...

Additional arguments passed to the specific summary sub-function.

Details

timing_trajectory() calculates both the number of unique timing trajectories in each cluster and the average timing trajectories in each cluster.

Value

timing_trajectory() returns a list of class timing_trajectory with two data frames:

average

  • Clustering the name of the clustering.

  • Cluster the cluster name.

  • timing variables the average timing value in the cluster.

  • Count the number of people in the cluster.

individual

  • Clustering the name of the clustering.

  • Cluster the cluster name.

  • timing variables unique timing pattern in the cluster.

  • Count number of people with this unique timing pattern.

Examples

clust <- medic(
  complications,
  id = id,
  atc = atc,
  k = 3:5,
  timing = first_trimester:third_trimester
)

timing_trajectory(clust, k == 5, clusters = I:III)


tame documentation built on April 12, 2025, 1:40 a.m.