Learn R Programming

tame (version 0.2.0)

medication_frequency: ATC Code Frequency Within Clusters

Description

The function medications() calculates the frequency of the different unique ATC codes within each cluster.

Usage

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

Value

medication_frequency() returns a data frame with class medication_frequency.

  • Clustering the name of the clustering.

  • Cluster the cluster name.

  • atc ATC codes.

  • Count number of individuals with this ATC code in this cluster.

  • Percent of All Medication the percentage of individuals in the study with this ATC code and cluster.

  • Percent of Medication in Cluster the percent of individuals in the cluster with this ATC code.

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

medication_frequency() calculates the number of individuals with a specific ATC code within a cluster. Moreover, it calculates the percentage of people with this medication assigned to this cluster and the percent of people within the cluster with this medication.

Examples

Run this code
clust <- medic(complications, id = id, atc = atc, k = 3:5)

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

Run the code above in your browser using DataLab