Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

>100% CMA_sliding_window #148

Open
dffyfe opened this issue Jan 28, 2021 · 1 comment
Open

>100% CMA_sliding_window #148

dffyfe opened this issue Jan 28, 2021 · 1 comment
Assignees
Labels
AdhereR(base) suggestion Suggestion/investigation

Comments

@dffyfe
Copy link
Collaborator

dffyfe commented Jan 28, 2021

Hi Dan,

I've been comparing CMA7 to Ambers manual Adherence work and it seems pretty much bang on (I think any differences can be put down to rounding or human error). One thing that would be good as an addition is the option to show >100% adherence on the sliding window with all the overuse going into the last window. i.e. in the example below show 100%, 100%, 100%, 364%. Obviously if it was 1 window we'd want to show overuse in that.

GT100 <- tribble(
  ~PATIENT_ID,	~DATE,	~PERDAY,	~CATEGORY,	~DURATION,
  1,	"2020-06-01",	2,	"medA",	40,
  1,	"2020-06-29",	2,	"medA",	40,
  1,	"2020-07-27",	2,	"medA",	40,
  1,	"2020-08-24",	2,	"medA",	40,
  1,	"2020-09-21",	2,	"medA",	40,
  1,	"2020-10-19",	2,	"medA",	40,
  1,	"2020-11-16",	2,	"medA",	40,
  1,	"2020-12-14",	2,	"medA",	40,
  1,	"2021-01-11",	2,	"medA",	40,
  1,	"2021-02-08",	2,	"medA",	40,
  1,	"2021-03-08",	2,	"medA",	40,
  1,	"2021-04-05",	2,	"medA",	40,
  1,	"2021-05-03",	2,	"medA",	40,
  1,	"2021-05-31",	2,	"medA",	40,
  1,	"2021-06-28",	2,	"medA",	40,
  1,	"2021-07-26",	2,	"medA",	40,
  1,	"2021-08-23",	2,	"medA",	40,
  1,	"2021-09-20",	2,	"medA",	40,
  1,	"2021-10-18",	2,	"medA",	40,
  1,	"2021-11-15",	2,	"medA",	40,
  1,	"2021-12-13",	2,	"medA",	40
)

GT100$DATE <- as.Date(GT100$DATE)

cma7 <- CMA_sliding_window(CMA.to.apply = "CMA7",
                           data=GT100,
                           ID.colname = "PATIENT_ID",
                           event.date.colname = "DATE",
                           event.duration.colname = "DURATION",
                           medication.class.colname = "CATEGORY",
                           carry.only.for.same.medication = FALSE,
                           followup.window.start = as.Date("2020-06-01"),
                           followup.window.start.unit = "days",
                           followup.window.duration = 600,
                           followup.window.duration.unit = "days",
                           observation.window.start = as.Date("2021-01-01"), 
                           observation.window.start.unit = "days",
                           observation.window.duration = 365,
                           observation.window.duration.unit = "days",
                           sliding.window.start = 0,
                           sliding.window.start.unit = "days",
                           sliding.window.duration = 91,
                           sliding.window.duration.unit = "days",
                           #sliding.window.step.duration = 91,
                           #sliding.window.step.unit = "days",
                           sliding.window.no.steps = 4,
                           date.format = "%Y-%m-%d")

plot(cma7, show.period = "dates", 
     period.in.days = 28,
     show.legend = FALSE,
     ylab = c(withCMA = "Section - Drug Name"),
     cex.axis = 1,
     title = "CHIno",
     CMA.cex = 0.8,
     plot.CMA = T,
     plot.CMA.as.histogram = F,
     CMA.plot.ratio = 0.000000000000000000000001,
     min.plot.size.in.characters.horiz=0,
     min.plot.size.in.characters.vert=0)

Best,

David

@ddediu ddediu added AdhereR(base) suggestion Suggestion/investigation labels Jan 28, 2021
@ddediu
Copy link
Owner

ddediu commented May 25, 2022

Actually seems to be a more general question about a new (?) CMA that can allow (controlled) overuse...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AdhereR(base) suggestion Suggestion/investigation
Projects
None yet
Development

No branches or pull requests

3 participants