timing_atc_group {tame} | R Documentation |
Timing and ATC pattern interactions
Description
The function timing_atc_group()
calculates the frequencies of distinct
timing and ATC combinations within clusters.
Usage
timing_atc_group(
object,
only = NULL,
clusters = NULL,
atc_groups = default_atc_groups,
additional_data = NULL,
...
)
Arguments
object |
An object for which a summary is desired. |
only |
< The default |
clusters |
< The default |
atc_groups |
A data.frame specifying the ATC groups to summaries by or a funciton that returns such a data.frame. The data.frame must have two columns:
As a standard the anatomical level (first level) of the ATC codes is used. |
additional_data |
A data frame with additional data that may be
(left-)joined onto the |
... |
Additional arguments passed to the specific summary sub-function. |
Details
timing_atc_group()
calculates both the number of people with unique timing
trajectory and ATC group, as given by atc_groups
, in each cluster.
Value
timing_atc_group()
returns a list of class
timing_atc_group
with two data frames:
average
-
Clustering
the name of the clustering. -
Cluster
the name of the cluster. -
ATC Groups
the name of the ATC group. The groups are given by theatc_groups
input. -
timing variables the average timing value in the ATC group and cluster.
-
Number of Medications
the number of medications in the ATC group in the cluster. -
Percentage of Medications
the percentage of medication in the cluster with this ATC group. -
Number of Distinct Timing Trajectories
the number of unique timing trajectories in the ATC group in the cluster.
individual
-
Clustering
the name of the clustering. -
Cluster
the name of the cluster. -
timing variables a unique timing pattern in the ATC group and cluster.
-
Number of Medications with Timing Trajectory
the number of medications with this unique timing trajectory and ATC group.
Examples
clust <- medic(
complications,
id = id,
atc = atc,
k = 3:5,
timing = first_trimester:third_trimester
)
timing_atc_group(clust, k == 5, clusters = I:III)