Make cluster characterizing summaries.
# S3 method for medic
summary(
object,
only = NULL,
clusters = NULL,
outputs = "all",
additional_data = NULL,
...
)
A list of clustering characteristics of class summary.medic
is returned. It
can contain any of the following characteristics:
The number of individuals assigned to each cluster and the associated frequency of assignment.
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.
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.
The number of unique timing trajectories in each cluster, and the average timing trajectories in each cluster.
The number of people with unique timing trajectory and ATC group, as given by
atc_groups
, in each cluster.
An object for which a summary is desired.
<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
.
<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
.
A character vector naming the desired characteristics to output. The default names all possible output types.
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.
clust <- medic(
complications,
id = id,
atc = atc,
k = 3:5,
timing = first_trimester:third_trimester
)
summary(clust)
Run the code above in your browser using DataLab