set_change_point: set_change_point

Description Usage Arguments Value Examples

View source: R/set_cp_function.R

Description

Set the change point and identify the optimal method to model the data prior to the change point

Usage

1
2
3
4
5
6
7
8
9
set_change_point(
  data,
  var_name = "n_miss_visits",
  method = NULL,
  compare_all_methods = FALSE,
  return_miss_only = FALSE,
  week_period = FALSE,
  specify_cp = NULL
)

Arguments

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

Value

A list containing tibbles of information about missed visits

Examples

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)

aarmiller/delayDX documentation built on July 11, 2021, 4:01 p.m.