comedication_count {tame} | R Documentation |
Frequency tables for medication amount
Description
The function comedication_count()
calculates the number of unique
medications for each individual and presents the count frequencies by
cluster.
Usage
comedication_count(
object,
only = NULL,
clusters = NULL,
count_grouper = function(x) {
cut(x, breaks = c(0, 1, 2, Inf), labels = c("1",
"2", "3+"))
},
additional_data = NULL,
...
)
Arguments
object |
An object for which a summary is desired. |
only |
< The default |
clusters |
< The default |
count_grouper |
A function for grouping counts. As a standard it groups counts as 1 medication, 2 medications, and 3+ medications. |
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
comedication_count()
calculates the number of ATC codes an individual has,
and then outputs the number of individuals within a cluster that has that
many ATC codes. Moreover, various relevant percentages or calculated. See
Value below for more details on these percentages.
Value
comedication_count()
returns a data frame of class
comedication_count
-
Clustering
the name of the clustering. -
Cluster
the name of the cluster. -
Medication Count
a number of medications. The numbers or groups are given by thecount_grouper()
function. -
Number of People
the number of individuals in cluster who hasMedication Count
number of comedications in study. -
Number of medications
the number of medications of individuals who hasMedication Count
number of comedications in the cluster. -
Percentage of All People
the percentage of individuals is study who hasMedication Count
number of comedications in the cluster. -
Percentage of People in Cluster
the percentage of individuals in the cluster who hasMedication Count
number of comedications. -
Percentage of All Medications
the percentage of medication in study from individuals who hasMedication Count
number of comedications in cluster. -
Percentage of Medication in Cluster
the percentage of medication in cluster from individuals who hasMedication Count
number of comedications. -
Percentage of People with the Same Medication Count
percentage of individuals among those withMedication Count
number of comedications in this cluster. -
Percentage of Medication with the Same Medication Count
percentage of medication among medication of individuals withMedication Count
number of comedications in this cluster.
Examples
clust <- medic(complications, id = id, atc = atc, k = 3:5)
comedication_count(clust, k == 5, clusters = I:III)