Description Usage Arguments Value Examples
View source: R/set_cp_function.R
Set the change point and identify the optimal method to model the data prior to the change point
1 2 3 4 5 6 7 8 9 |
data |
A dataset of visit counts, output by count_prior_events_truven |
var_name |
The name of the count variable to find the change-point for |
method |
The method used to find changepoint. Options include "linear", "quadratic", "cubic", "quartic", "quintic", "sextic" , or "exponential" |
compare_all_methods |
A logical to compare all available. If TRUE, will return a tibble of methods by evaluation criteria |
return_miss_only |
Logical argument to only return the tibbles of miss visit counts |
week_period |
Logical to incorporate a "day of the week" effect into the momdel Note this is only sensible for one-day period aggregation |
specify_cp |
A postive integer value for the specific change point you want to use. The value represents the days before the index on which you you want to specify the change point. (e.g. 100 would be 100 days before the index) |
eval_criteria |
The evaluation criteria used to compare models |
A list containing tibbles of information about missed visits
1 2 3 | results <- final_time_map %>%
count_prior_events_truven(event_name = "any_ssd", start_day = 1, by_days = 1) %>%
set_change_point(var_name = "n_miss_visits", method = "cubic", specify_cp = 21)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.