Hi there! I'm trying to do a simple interrupted time series and I am running into a lot of trouble as I have never done this before.
I want to see if renewals of specific medications decreased in March 2020 by comparing what the rate of growth had been at a particular community clinic between 2018-March2020 to what the clinic experienced between March-September 2020.
From my research, I think the itsa.model function should be used from the its.analysis library. Perhaps I should be using a different approach?
Using itsa.model, the independent variable should be any date after March 2020 (this was identified through the creation of a new column and assigning "1" to the values after March and 0 before-- "renewals_itsa") and the dependent variable is the sum of prescription refills-- "renewals". Time is based off prescription fill year and month-- "start_month_year".
Here's what I have so far, but it's not working. Any advice or pointers of if I am on the right track would be very helpful!
itsa.model(data = renewals_itsa, time = "start_month_year", dependent_variable = "renewals", interrupt_var = "inter_val", alpha=0.05, bootstrap=TRUE, Reps = 250) #> Error in itsa.model(data = renewals_itsa, time = "start_month_year", dependent_variable = "renewals", : could not find function "itsa.model"
Created on 2020-12-26 by the reprex package (v0.3.0)