getCMA: Access the actual CMA estimate from a CMA object.

View source: R/adherer.R

getCMAR Documentation

Access the actual CMA estimate from a CMA object.

Description

Retrieve the actual CMA estimate(s) encapsulated in a simple, per episode, or sliding window CMA object.

Usage

getCMA(
  x,
  flatten.medication.groups = FALSE,
  medication.groups.colname = ".MED_GROUP_ID"
)

Arguments

x

a CMA object.

flatten.medication.groups

Logical, if TRUE and there are medication groups defined, then the return value is flattened to a single data.frame with an extra column containing the medication group (its name is given by medication.groups.colname).

medication.groups.colname

a string (defaults to ".MED_GROUP_ID") giving the name of the column storing the group name when flatten.medication.groups is TRUE.

Value

a data.frame containing the CMA estimate(s).

Examples

cma1 <- CMA1(data=med.events,
             ID.colname="PATIENT_ID",
             event.date.colname="DATE",
             event.duration.colname="DURATION",
             followup.window.start=30,
             observation.window.start=30,
             observation.window.duration=365,
             date.format="%m/%d/%Y"
            );
getCMA(cma1);
## Not run: 
cmaE <- CMA_per_episode(CMA="CMA1",
                        data=med.events,
                        ID.colname="PATIENT_ID",
                        event.date.colname="DATE",
                        event.duration.colname="DURATION",
                        event.daily.dose.colname="PERDAY",
                        medication.class.colname="CATEGORY",
                        carry.only.for.same.medication=FALSE,
                        consider.dosage.change=FALSE,
                        followup.window.start=0,
                        observation.window.start=0,
                        observation.window.duration=365,
                        date.format="%m/%d/%Y"
                       );
getCMA(cmaE);
## End(Not run)

AdhereR documentation built on July 5, 2022, 5:08 p.m.