Description Usage Arguments Value Examples
Identify changepoint using pettitt method, and find expected SSD visits/calculate misses by fitting a linear model before the changepoint
1 2 3 4 5 6 7 8 |
data |
A dataframe output by count_prior_events_truven |
var_name |
A character string of outcome for which to apply analysis |
return_miss_only |
Logical to only return miss information |
week_period |
Logical to incorporate a "day of the week" effect into the linear model. Note this is only sensible for one-day period aggregation. |
specify_cp |
Set a specific change point you want to use instead of searching for optimal change point. Enter a postive integer value repersenting 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) |
auto_reg |
Logical that determines whether expected counts use a time-series framework that incorporates autoregression. If week_period is FALSE, will use a 7-day seasonality component. If week_period is TRUE, will use an additive indicator |
A list containing miss information, changepoint information, predictions, the model itself, and a plot of the middle finger curve and model.
1 2 3 4 | cp_result_pettit <- final_time_map %>%
filter(days_since_dx >= -180) %>%
count_prior_events_truven(event_name = "any_ssd", start_day = 1, by_days = 1) %>%
find_cp_pettitt(var_name = "n_miss_visits", return_miss_only = FALSE, week_period=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.