Given the input of the medic
this function checks the
input and constructs a data frame with the analysis parameters specified by
the user.
parameters_constructor(
data,
id,
k = 5,
atc,
timing,
base_clustering,
linkage = "complete",
summation_method = "sum_of_minima",
alpha = 1,
beta = 1,
gamma = 1,
p = 1,
theta = (5:0)/5,
...
)
A data.frame with the parameters for clustering.
A data frame containing all the variables for the clustering.
<tidy-select
> An unquoted
expression naming the variable in data
describing person id.
a vector specifying the number of clusters to identify.
<tidy-select
> An unquoted
expression naming the variable in data
containing ATC codes.
<tidy-select
> An unquoted
expression naming the variable or variables in data
describing
medication timing. Variable names can be used as if they were positions in
the data frame, so expressions like x:y can be used to select a range of
variables. Moreover, pattern matching selection helpers such as
starts_with
or
num_range
may also be used to select timing
variables.
<tidy-select
> An
unquoted expression naming the variable in data
that gives an initial
clustering to start the medic
from or NULL
.
The agglomeration method to be used in the clustering. This should be (an unambiguous abbreviation of) one of "ward.D", "ward.D2", "single", "complete", "average" (= UPGMA), "mcquitty" (= WPGMA), "median" (= WPGMC) or "centroid" (= UPGMC). See stats::hclust for more information. For a discussion of linkage criterion choice see details below.
The summation method used in the distance measure. This should be either "double_sum" or "sum_of_minima". See details below for more information.
A number giving the tuning of the normalization. See details below for more information.
A number giving the power of the individual medication combinations. See details below for more information.
A number giving the weight of the timing terms. See details below for more information.
The power of the Minkowski distance used in the timing-specific distance. See details below for more information.
A vector of length 6 specifying the tuning of the ATC measure. See details below for more information.
Additional arguments not currently in use.
parameters_constructor(
data = complications,
k = 3,
id = id,
atc = atc
)
Run the code above in your browser using DataLab