Skip to content

Instantly share code, notes, and snippets.

@githoov
Last active April 12, 2016 20:23
Show Gist options
  • Select an option

  • Save githoov/417c2c7319bf8d7329ea368c54fed676 to your computer and use it in GitHub Desktop.

Select an option

Save githoov/417c2c7319bf8d7329ea368c54fed676 to your computer and use it in GitHub Desktop.
# input queries
# tickets: https://metanew.looker.com/x/CQ9zcpw
# discourse views: https://metanew.looker.com/x/yYf3CPH
# load data
tickets <- read.csv(file = "~/Downloads/ticket_topics.csv", header = TRUE)
articles <- read.csv(file = "~/Downloads/discourse_topics.csv", header = TRUE)
# rename columns
names(tickets) <- c("week", "topic", "chats")
names(articles) <- c("week", "topic", "views")
# inner join tickets and articles. implicitly inner joins on shared column names
df <- merge(articles, tickets)
# naive regression
summary(lm(chats ~ views + topic + time(week), data = df))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment