parameters_constructor {tame}R Documentation

Internal option constructor

Description

Given the input of the medic this function checks the input and constructs a data frame with the analysis parameters specified by the user.

Usage

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,
  ...
)

Arguments

data

A data frame containing all the variables for the clustering.

id

<tidy-select> An unquoted expression naming the variable in data describing person id.

k

a vector specifying the number of clusters to identify.

atc

<tidy-select> An unquoted expression naming the variable in data containing ATC codes.

timing

<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.

base_clustering

<tidy-select> An unquoted expression naming the variable in data that gives an initial clustering to start the medic from or NULL.

linkage

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.

summation_method

The summation method used in the distance measure. This should be either "double_sum" or "sum_of_minima". See details below for more information.

alpha

A number giving the tuning of the normalization. See details below for more information.

beta

A number giving the power of the individual medication combinations. See details below for more information.

gamma

A number giving the weight of the timing terms. See details below for more information.

p

The power of the Minkowski distance used in the timing-specific distance. See details below for more information.

theta

A vector of length 6 specifying the tuning of the ATC measure. See details below for more information.

...

Additional arguments not currently in use.

Value

A data.frame with the parameters for clustering.

Examples

parameters_constructor(
   data = complications, 
   k = 3, 
   id = id,
   atc = atc
)


[Package tame version 0.0.1 Index]