amounts {tame} | R Documentation |
Frequency tables for medication amount
Description
The function amounts()
calculates the number of unique
medications for each individual and presents the count frequencies by
cluster.
Usage
amounts(
clustering,
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
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 internal summary function.
|
Details
amounts()
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
amounts()
returns a data frame of class summary.medic.amounts
-
cluster_name
the name of the clustering. -
cluster
the cluster name. -
m
number of ATC codes. -
n_people
number of people incluster
that hasm
different ATC codes. -
n_medications
the total number of medication across people in thiscluster
withm
different ATC codes. -
p_people_analysis
percentage of people incluster
withm
different ATC codes in analysis. -
p_people_cluster
percentage of people withm
different ATC codes incluster
. -
p_medications_in_analysis
percentage of medication given incluster
withm
different ATC codes in analysis. -
p_medications_in_cluster
percentage of medication given withm
different ATC codes incluster
. -
p_people_with_n_unique_medications
percentage of people incluster
withm
different ATC codes. -
p_medications_with_n_unique_medications
percentage of medication incluster
withm
different ATC codes.