AdhereR
AdhereR copied to clipboard
Plot ploypharmacy
Time series:
- one ts per medication class
General:
- define medication classes as a list of vectors of medication names
- define the format of the Polypharmacy object + interface needed by siding windows
Now, groups of medications can be defined as a list (possibly named) of vectors of medication class names. If the names are not given, they are automatically generated by concatenating (separated by "+") the values of the vector. Class names not explicitly included are considered to form their own class. If the group is NULL, all classes are considered to belong to a single overall group.
For sliding windows/per episode (for each patient), the "simple" CMA
function is repeatedly called for a new OW (=the current sliding window/episode) and should return an object ultimately derived from CMA0
. The important members of this object are its class
(to be saved in the results) and, currently, a single number accessed as the $CMA
member (or, alternatively, through the getCMA()
getter function).
For polypharmacy then, your object should:
- be ultimately derived from
CMA0
- have a member
$CMA
(also accessible throughgetCMA()
) that returns a single number == the global estimate for a given patient - have a different member (say)
$CMA.individual
(or$CMA.separate
or$CMA.raw
or whatever we agree on) that contains adata.frame
with the separate estimate for each medication/interval/whatever is relevant - have a member that describes/contains the function used for "combining" the "raw" individual estimates (for printing, etc)
Would this work?