Description Usage Arguments Functions See Also Examples
Convenience functions for running a model using selected defaults.
1 2 3 4 5 6 7 8 9 10 11 | yrs_fit_renew(train_df, model = function(train_df) { glm(renew ~
num_years_held + log(years_since), family = binomial(link = "logit"),
data = train_df) })
yrs_fit_renew_prep(train_df)
yrs_fit_retain(train_df, model = function(train_df) lm(pct ~
log(years_since), data = train_df))
yrs_fit_retain_gam(train_df, model = function(train_df) gam(pct ~
s(years_since, sp = 0.1), data = train_df))
|
train_df |
data frame to use as training dataset |
model |
function used to model training dataset |
yrs_fit_renew
: Fit license buying - renewal, logit
yrs_fit_renew_prep
: Helper function to prepare data for renewal fit
yrs_fit_retain
: Fit license buying - retention, log
yrs_fit_retain_gam
: Fit license buying - retention, gam
Other functions to estimate annual license buying: yrs_avidity
,
yrs_calc_avg
, yrs_calc
,
yrs_lifetime
, yrs_plot
,
yrs_predict_avg
, yrs_predict
,
yrs_result
, yrs_zero
1 2 3 4 5 6 7 8 9 10 11 12 | library(dplyr)
data(all_sports)
all_sports <- yrs_avidity(all_sports, drop_na_yrs = FALSE)
df_split <- yrs_zero_split(all_sports) %>%
yrs_zero_filter(function(x) filter(x, age_year == 30))
train_df <- yrs_calc_renew(df_split)
yrs_fit_renew(train_df)
train_df <- yrs_calc_retain(df_split)
yrs_fit_retain(train_df)
yrs_fit_retain_gam(train_df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.