podlove_episode_regression: Caluclate download regression

Description Usage Arguments Details Value Examples

View source: R/podlove_episode_regression.R

Description

This function takes data from a podlove_downloads_until() and calculates a regression model with downloads as outcome variable. This allows to find out if the podcast gains or loses listeners over successive episodes.

Usage

1
2
3
4
5
podlove_episode_regression(
  df_regression_data,
  terms = "post_datehour",
  printout = TRUE
)

Arguments

df_regression_data

a tidy data table created by podlove_downloads_until(). Note that this function should not be fed data including more than one point_in_time unless vectorized.

terms

terms (predictors) of the linear model as string. Usually contains at least one time or order based variable such as post_date, post_datehour (default), episode_age_hours/episode_age_days (note: age decreases with episodes!) or episode_rank. This parameter can also include multiple variables for more advanced models. See ?lm for more information.

printout

switcher to print out the model's summary after calculation.

Details

Details

Value

a linear reression model created by lm().

Examples

1
2
3
4
5
6
## Not run: 
# linear regression for downloads on day 3 by episode release date
dl <- podlove_downloads_until(podcast_example_data, points_in_time = 3)
podlove_episode_regression(dl, terms = "post_datehour")

## End(Not run)

lordyo/podlover documentation built on Feb. 20, 2020, 5:58 p.m.